From e2949362ba3e791d0418d682fecf844373848ee6 Mon Sep 17 00:00:00 2001 From: chenos Date: Fri, 15 Jul 2022 20:45:43 +0800 Subject: [PATCH] fix: localStorage is not defined --- packages/core/sdk/src/APIClient.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/sdk/src/APIClient.ts b/packages/core/sdk/src/APIClient.ts index 9add8fe42..5c1ffb1e5 100644 --- a/packages/core/sdk/src/APIClient.ts +++ b/packages/core/sdk/src/APIClient.ts @@ -187,7 +187,7 @@ export class APIClient { private initStorage(storage?: any) { if (storage) { this.storage = new storage(this); - } else if (localStorage) { + } else if (typeof localStorage !== 'undefined') { this.storage = localStorage; } else { this.storage = new MemoryStorage();