Skip to content

Commit

Permalink
fix: load default config when error occur
Browse files Browse the repository at this point in the history
  • Loading branch information
slient-coder committed May 30, 2023
1 parent 5c5b5f2 commit b4352fd
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/background/service/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,18 @@ export class OpenApiService {
this.store.deviceId = randomstring.generate(12);
}

// const getConfig = async () => {
// try {
// this.store.config = await this.getWalletConfig();
// } catch (e) {
// setTimeout(() => {
// getConfig(); // reload openapi config if load failed 5s later
// }, 5000);
// }
// };
// getConfig();
const getConfig = async () => {
try {
this.store.config = await this.getWalletConfig();
} catch (e) {
this.store.config = {
version: '0.0.0',
moonPayEnabled: true,
statusMessage: (e as any).message
};
}
};
getConfig();
};

setClientAddress = async (token: string) => {
Expand Down

0 comments on commit b4352fd

Please sign in to comment.