File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -51,12 +51,13 @@ export class ParseOffline {
5151 } ) : CachedResults {
5252 const { className, localStorageKey } = params ;
5353
54+ // Get the previous items in the localStorage
5455 const previousItems = window . localStorage . getItem (
5556 localStorageKey || // from an arbitrary key
5657 ParseOffline . getLocalStorageKeyForClassName ( className ) , // for an autogenerated key
5758 ) ;
5859
59- // return if there were no previous items
60+ // return an empty set if there were no previous items
6061 if ( ! previousItems ) return new CachedResults ( [ ] ) ;
6162
6263 // parse the previous results
@@ -119,6 +120,7 @@ export class ParseOffline {
119120
120121 if ( maxAge && ! ParseOffline . areCachedResultsValid ( cachedResults , maxAge ) ) {
121122 throw new Error ( 'Cached results are not valid anymore' ) ;
123+ // return [];
122124 }
123125
124126 return cachedResults . toParseObjs ( query . className ) ;
You can’t perform that action at this time.
0 commit comments