File tree Expand file tree Collapse file tree 6 files changed +16
-30
lines changed
Expand file tree Collapse file tree 6 files changed +16
-30
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" d-inline-block" >
33 <span v-if =" showDocumentBadge" class =" badge-document" >{{ t('document.message') }}</span >
4- <span v-if =" showChromeBadge" class =" badge-chrome" >Chrome</span >
54 <span v-if =" showLimitBadge" class =" badge-block" >{{ t('limit.message') }}</span >
65 </div >
76</template >
@@ -37,18 +36,9 @@ const showLimitBadge = computed(
3736 (props .listType == TypeOfList .Today || props .listType == TypeOfList .Dashboard ) &&
3837 isLimit .value == true ,
3938);
40- const showChromeBadge = computed (() => props .type == TypeOfUrl .Chrome );
4139 </script >
4240
4341<style scoped>
44- span .badge-chrome {
45- border-radius : 6px ;
46- background-color : #3aab58 ;
47- padding : 3px 7px ;
48- font-size : 11px ;
49- color : white ;
50- font-weight : 600 ;
51- }
5242span .badge-document {
5343 border-radius : 6px ;
5444 background-color : #0043ff9e ;
Original file line number Diff line number Diff line change @@ -47,12 +47,9 @@ const props = defineProps<{
4747 listType: TypeOfList ;
4848}>();
4949
50- const typeOfUrl = computed (() => {
51- if (props .item .url .startsWith (' file:' )) return TypeOfUrl .Document ;
52- if (props .item .url .startsWith (' chrome://' ) || props .item .url .startsWith (' chrome-extension://' ))
53- return TypeOfUrl .Chrome ;
54- return TypeOfUrl .WebSite ;
55- });
50+ const typeOfUrl = computed (() =>
51+ props .item .url .startsWith (' file:' ) ? TypeOfUrl .Document : TypeOfUrl .WebSite ,
52+ );
5653
5754const url = computed (() =>
5855 typeOfUrl .value == TypeOfUrl .Document
Original file line number Diff line number Diff line change @@ -6,10 +6,6 @@ export function extractHostname(url: string | undefined): string {
66 return url ;
77 }
88
9- if ( url . startsWith ( 'chrome://' ) || url . startsWith ( 'chrome-extension://' ) ) {
10- return url ;
11- }
12-
139 if ( url . indexOf ( '//' ) > - 1 ) {
1410 hostname = url . split ( '/' ) [ 2 ] ;
1511 } else {
Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ export function isValidPage(tab: Browser.Tabs.Tab | undefined): boolean {
44 if ( tab == null || tab == undefined || ! tab . url || ! tab . id ) return false ;
55
66 if (
7- ! tab . url . startsWith ( 'http:' ) &&
8- ! tab . url . startsWith ( 'https:' ) &&
9- ! tab . url . startsWith ( 'file:' ) &&
10- ! tab . url . startsWith ( 'chrome://' ) &&
11- ! tab . url . startsWith ( 'chrome-extension://' )
7+ ( ! tab . url . startsWith ( 'http:' ) &&
8+ ! tab . url . startsWith ( 'https:' ) &&
9+ ! tab . url . startsWith ( 'file:' ) ) ||
10+ tab . url . startsWith ( 'chrome://' ) ||
11+ tab . url . startsWith ( 'chrome-extension://' )
1212 )
1313 return false ;
1414 return true ;
Original file line number Diff line number Diff line change @@ -63,14 +63,18 @@ async function trackTime() {
6363 await mainTrackerWrapper ( activeTab ! , activeDomain , tab ) ;
6464 }
6565 }
66- }
66+ } else await closeOpenInterval ( ) ;
6767 } else {
68- await closeInterval ( activeTabInstance . getActiveTabDomain ( ) ) ;
69- activeTabInstance . setActiveTab ( null ) ;
70- currentObj = null ;
68+ await closeOpenInterval ( ) ;
7169 }
7270}
7371
72+ async function closeOpenInterval ( ) {
73+ await closeInterval ( activeTabInstance . getActiveTabDomain ( ) ) ;
74+ activeTabInstance . setActiveTab ( null ) ;
75+ currentObj = null ;
76+ }
77+
7478async function mainTracker (
7579 state : Browser . Idle . IdleState ,
7680 activeTab : Browser . Tabs . Tab ,
Original file line number Diff line number Diff line change @@ -27,5 +27,4 @@ export enum ListWithTime {
2727export enum TypeOfUrl {
2828 WebSite ,
2929 Document ,
30- Chrome ,
3130}
You can’t perform that action at this time.
0 commit comments