Skip to content

Commit

Permalink
Don't use local storage if it's not supported.
Browse files Browse the repository at this point in the history
This was causing issues with react native.
  • Loading branch information
niemyjski committed Jul 15, 2021
1 parent 7c465d7 commit fa079d2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/core/src/configuration/Configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,9 @@ export class Configuration {
* Use localStorage for persisting things like server configuration cache and persisted queue entries (depends on usePersistedQueueStorage).
*/
public useLocalStorage(): void {
this.services.storage = new LocalStorage();
if (globalThis?.localStorage) {
this.services.storage = new LocalStorage();
}
}

/**
Expand Down

0 comments on commit fa079d2

Please sign in to comment.