Skip to content

Commit

Permalink
fix undefined check
Browse files Browse the repository at this point in the history
  • Loading branch information
salazarm committed Jun 11, 2024
1 parent 15c7d7b commit fb3ce98
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class HourlyDataCache<T> {
return;
}
if (!(await this.indexedDBCache.has(this.indexedDBKey))) {
console.log('not has');
res();
return;
}
Expand All @@ -65,7 +66,7 @@ export class HourlyDataCache<T> {
private saveTimeout?: ReturnType<typeof setTimeout>;
private registeredUnload: boolean = false;
private async saveCacheToIndexedDB() {
if (typeof jest !== undefined) {
if (typeof jest !== 'undefined') {
if (!this.indexedDBCache) {
return;
}
Expand All @@ -77,6 +78,7 @@ export class HourlyDataCache<T> {
if (!this.indexedDBCache) {
return;
}
debugger;
this.indexedDBCache.set(this.indexedDBKey, this.cache, defaultOptions);
}, 10000);
if (!this.registeredUnload) {
Expand Down

0 comments on commit fb3ce98

Please sign in to comment.