Skip to content

Commit

Permalink
Change timeout to variable
Browse files Browse the repository at this point in the history
  • Loading branch information
shepherd-l committed Sep 9, 2024
1 parent 408d982 commit 4812749
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/page/managers/LoginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,15 @@ export default class LoginManager {
static async fetchAndHydrate(onesignalId: string): Promise<void> {
logMethodCall('LoginManager.fetchAndHydrate', { onesignalId });

await awaitableTimeout(3000);
const newRecordsState = OneSignal.coreDirector.getNewRecordsState();

if (!newRecordsState) {
Log.error(`fetchAndHydrate: NewRecordsState is undefined`);
} else {
const delay = newRecordsState.OP_REPO_POST_CREATE_DELAY;
await awaitableTimeout(delay);
}

const fetchUserResponse = await RequestService.getUser(
{ appId: await MainHelper.getAppId() },
new AliasPair(AliasPair.ONESIGNAL_ID, onesignalId),
Expand Down

0 comments on commit 4812749

Please sign in to comment.