File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -16,22 +16,27 @@ export class Tab implements ISerializable<Tab> {
1616 this . summaryTime += 1 ;
1717
1818 const day = this . days . find ( x => x . date == todayLocalDate ( ) ) ;
19- if ( day === undefined ) this . addNewDay ( ) ;
20- else day . incSummaryTime ( ) ;
19+ if ( day === undefined ) {
20+ const newTab = this . addNewDay ( ) ;
21+ newTab . incSummaryTime ( ) ;
22+ } else day . incSummaryTime ( ) ;
2123 }
2224
2325 incCounter ( ) : void {
2426 this . counter += 1 ;
2527 if ( __DEV__ ) logger . log ( `Counter ${ this . url } - ${ this . counter } ` ) ;
2628 const day = this . days . find ( x => x . date == todayLocalDate ( ) ) ;
27- if ( day === undefined ) this . addNewDay ( ) ;
28- else day . incCounter ( ) ;
29+ if ( day === undefined ) {
30+ const newTab = this . addNewDay ( ) ;
31+ newTab . incCounter ( ) ;
32+ } else day . incCounter ( ) ;
2933 }
3034
31- addNewDay ( ) : void {
35+ addNewDay ( ) : TabDay {
3236 const newTabDay = new TabDay ( ) ;
3337 newTabDay . init ( todayLocalDate ( ) ) ;
3438 this . days . push ( newTabDay ) ;
39+ return newTabDay ;
3540 }
3641
3742 deserialize ( input : Tab ) {
@@ -56,8 +61,6 @@ export class TabDay implements ISerializable<TabDay> {
5661
5762 init ( date : string ) {
5863 this . date = date ;
59- this . counter = 1 ;
60- this . summary = 1 ;
6164 }
6265
6366 incSummaryTime ( ) : void {
You can’t perform that action at this time.
0 commit comments