File tree Expand file tree Collapse file tree 2 files changed +18
-6
lines changed
Expand file tree Collapse file tree 2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -532,7 +532,7 @@ Menu.main = {
532532
533533Satus . storage . import ( function ( ) {
534534 var end_time = new Date ( ) . getTime ( ) ,
535- start_time = Satus . storage . get ( 'startTime' ) || start_time - 7.776e+9 ,
535+ start_time = Satus . storage . get ( 'startTime' ) || 0 ,
536536 language = 'en' ;
537537
538538 Satus . locale . import ( '_locales/' + language + '/messages.json' , function ( ) {
@@ -557,15 +557,21 @@ Satus.storage.import(function() {
557557 } ;
558558 }
559559
560- History [ host ] . visitCount += item . visitCount ;
561-
562560 History [ host ] . items [ url ] = {
563561 title : item . title ,
564562 visitCount : item . visitCount ,
565563 star : 0 ,
566564 tags : ''
567565 } ;
568566 }
567+
568+ for ( var key in History ) {
569+ History [ key ] . visitCount = 0 ;
570+
571+ for ( var i in History [ key ] . items ) {
572+ History [ key ] . visitCount += History [ key ] . items [ i ] . visitCount ;
573+ }
574+ }
569575
570576 Satus . storage . set ( 'history' , History ) ;
571577 Satus . storage . set ( 'startTime' , end_time ) ;
Original file line number Diff line number Diff line change 88
99Satus . storage . import ( function ( ) {
1010 var end_time = new Date ( ) . getTime ( ) ,
11- start_time = Satus . storage . get ( 'startTime' ) || start_time - 7.776e+9 ,
11+ start_time = Satus . storage . get ( 'startTime' ) || 0 ,
1212 language = 'en' ;
1313
1414 Satus . locale . import ( '_locales/' + language + '/messages.json' , function ( ) {
@@ -33,15 +33,21 @@ Satus.storage.import(function() {
3333 } ;
3434 }
3535
36- History [ host ] . visitCount += item . visitCount ;
37-
3836 History [ host ] . items [ url ] = {
3937 title : item . title ,
4038 visitCount : item . visitCount ,
4139 star : 0 ,
4240 tags : ''
4341 } ;
4442 }
43+
44+ for ( var key in History ) {
45+ History [ key ] . visitCount = 0 ;
46+
47+ for ( var i in History [ key ] . items ) {
48+ History [ key ] . visitCount += History [ key ] . items [ i ] . visitCount ;
49+ }
50+ }
4551
4652 Satus . storage . set ( 'history' , History ) ;
4753 Satus . storage . set ( 'startTime' , end_time ) ;
You can’t perform that action at this time.
0 commit comments