mirror of
https://github.com/ranaldsgift/KefinTweaks.git
synced 2026-11-05 07:42:47 +01:00
Fix requests firing before user is logged in
This commit is contained in:
@@ -267,6 +267,11 @@
|
||||
|
||||
async function initialize() {
|
||||
ensureApiClient();
|
||||
|
||||
// Wait for login
|
||||
if (window.userHelper?.waitForLogin) {
|
||||
await window.userHelper.waitForLogin();
|
||||
}
|
||||
|
||||
if (__libraries) {
|
||||
return;
|
||||
|
||||
@@ -3000,13 +3000,6 @@ window.KefinTweaksConfig = ${JSON.stringify(config, null, 2)};`;
|
||||
const hash = String(window.location.hash || '');
|
||||
let watchlistUrl = activePageWatchlistUrl || window.KefinTweaksUtils?._watchlistUrl || null;
|
||||
|
||||
if (!watchlistUrl) {
|
||||
getWatchlistUrl().then((url) => {
|
||||
activePageWatchlistUrl = url;
|
||||
updateActivePage();
|
||||
}).catch(() => { /* ignore */ });
|
||||
}
|
||||
|
||||
let page = '';
|
||||
const tabMatch = hash.match(/[?&]tab=(\d+)/);
|
||||
const tabIndex = tabMatch ? tabMatch[1] : null;
|
||||
|
||||
@@ -7637,6 +7637,10 @@ In the Custom Tabs plugin, add a new tab with the following HTML content:
|
||||
};
|
||||
|
||||
const run = async () => {
|
||||
if (window.userHelper?.waitForLogin) {
|
||||
await window.userHelper.waitForLogin();
|
||||
}
|
||||
|
||||
await addCustomWatchlistPage();
|
||||
await addCustomMenuLink();
|
||||
await addWatchlistPageHandler();
|
||||
|
||||
Reference in New Issue
Block a user