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 {
51
51
} ) : CachedResults {
52
52
const { className, localStorageKey } = params ;
53
53
54
+ // Get the previous items in the localStorage
54
55
const previousItems = window . localStorage . getItem (
55
56
localStorageKey || // from an arbitrary key
56
57
ParseOffline . getLocalStorageKeyForClassName ( className ) , // for an autogenerated key
57
58
) ;
58
59
59
- // return if there were no previous items
60
+ // return an empty set if there were no previous items
60
61
if ( ! previousItems ) return new CachedResults ( [ ] ) ;
61
62
62
63
// parse the previous results
@@ -119,6 +120,7 @@ export class ParseOffline {
119
120
120
121
if ( maxAge && ! ParseOffline . areCachedResultsValid ( cachedResults , maxAge ) ) {
121
122
throw new Error ( 'Cached results are not valid anymore' ) ;
123
+ // return [];
122
124
}
123
125
124
126
return cachedResults . toParseObjs ( query . className ) ;
You can’t perform that action at this time.
0 commit comments