Skip to content

Commit

Permalink
fix: error in extracting site info
Browse files Browse the repository at this point in the history
the AP_VARS are now initialized differently on the site, with it having
values added to multiple times, so our method of extracting them
had to be adjusted accordginly
  • Loading branch information
mangadoot committed Jul 15, 2023
1 parent a9ee0ac commit 1901575
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ export default class Site {
}

private async extractSiteInfo(): Promise<SiteInfo> {
await pWaitFor(() => isSomething(unsafeWindow.AP_VARS), { timeout: 2000 });
await pWaitFor(() => isSomething(unsafeWindow.AP_VARS) && isSomething(unsafeWindow.AP_VARS.ENTRY_INFO), {
timeout: 2000,
});

if (!isSomething(unsafeWindow.AP_VARS)) {
throw new Error('cannot extract site info: AP_VARS not set!');
Expand Down

0 comments on commit 1901575

Please sign in to comment.