File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ export function getItems(
161161 } ) ,
162162 abortController,
163163 } )
164- . promise . then ( ( response ) => response . json ( ) )
164+ . promise . then ( ( response : Response ) => response . json ( ) )
165165 . then ( enrichItemsResponse ) ;
166166}
167167
Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ class selfoss {
198198 this . db . enableOffline . update ( enableOffline ) ;
199199 window . localStorage . setItem (
200200 'enableOffline' ,
201- this . db . enableOffline . value ,
201+ this . db . enableOffline . value . toString ( ) ,
202202 ) ;
203203 if ( ! this . db . enableOffline . value ) {
204204 this . db . clear ( ) ;
@@ -439,7 +439,7 @@ class selfoss {
439439 return Promise . reject ( error ) ;
440440 }
441441
442- const httpCode = error ? .response ? .status || 0 ;
442+ const httpCode = 'response' in error ? error . response . status : 0 ;
443443
444444 if ( tryOffline && httpCode != 403 ) {
445445 return this . db . setOffline ( ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export default class DbOffline {
1515 public newerEntriesMissing : boolean = false ;
1616 public shouldLoadEntriesOnline : boolean = false ;
1717 public olderEntriesOnline : boolean = false ;
18+ public needsSync : boolean ;
1819
1920 _tr ( ...args ) {
2021 return selfoss . db . storage . transaction ( ...args ) . catch ( ( error ) => {
@@ -340,7 +341,11 @@ export default class DbOffline {
340341 reloadOnlineStats ( ) {
341342 return this . _tr ( 'r' , [ selfoss . db . storage . stats ] , ( ) => {
342343 selfoss . db . storage . stats . toArray ( ( stats ) => {
343- const newStats = { } ;
344+ const newStats = {
345+ unread : 0 ,
346+ starred : 0 ,
347+ total : 0 ,
348+ } ;
344349 stats . forEach ( ( stat ) => {
345350 newStats [ stat . name ] = stat . value ;
346351 } ) ;
Original file line number Diff line number Diff line change 66 ResponseItem ,
77 StatusUpdate ,
88 SyncParams ,
9+ SyncResponse ,
910} from './requests/items' ;
1011
1112export type FetchParams = {
You can’t perform that action at this time.
0 commit comments