File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import { Tab } from "../entity/tab" ;
2- import Browser from 'webextension-polyfill' ;
32
43export interface ITabsRepository {
54 getTabs ( ) : Tab [ ] ;
5+ getTodayTabs ( ) : Tab [ ] ;
66 getTab ( domain :string ) : Tab | undefined ;
77 addTab ( domain : string , favicon : string | undefined ) : Promise < Tab | undefined > ;
88}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { Tab } from "../entity/tab";
33import { injecStorage } from "../storage/inject-storage" ;
44import { isInBlackList } from "../compositions/black-list" ;
55import { StorageDeserializeParam } from "../storage/storage-params" ;
6+ import { todayLocalDate } from "../utils/today" ;
67
78export class TabsRepository implements ITabsRepository {
89 private tabs : Tab [ ] ;
@@ -21,6 +22,10 @@ export class TabsRepository implements ITabsRepository {
2122 return this . tabs ;
2223 }
2324
25+ getTodayTabs ( ) : Tab [ ] {
26+ return this . tabs . filter ( x => x . days . find ( s => s . date === todayLocalDate ( ) ) ) ;
27+ }
28+
2429 getTab ( domain : string ) : Tab | undefined {
2530 return this . tabs ?. find ( ( x ) => x . url === domain ) ;
2631 }
You can’t perform that action at this time.
0 commit comments