change spot refresh url getter
This commit is contained in:
parent
1bc96062fd
commit
ccca40011b
1 changed files with 9 additions and 3 deletions
|
|
@ -241,13 +241,19 @@ export default defineBackground(() => {
|
||||||
|
|
||||||
if (!pingInt) {
|
if (!pingInt) {
|
||||||
pingInt = setInterval(() => {
|
pingInt = setInterval(() => {
|
||||||
void pingJWT(url);
|
void pingJWT();
|
||||||
}, PING_INT)
|
}, PING_INT)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function pingJWT(ingest: string): Promise<void> {
|
async function pingJWT(): Promise<void> {
|
||||||
|
const data = await chrome.storage.local.get(["jwtToken", "settings"])
|
||||||
|
if (!data.settings) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const { jwtToken, settings } = data;
|
||||||
|
const ingest = safeApiUrl(settings.ingestPoint);
|
||||||
const refreshUrl = safeApiUrl(`${ingest}/api`);
|
const refreshUrl = safeApiUrl(`${ingest}/api`);
|
||||||
if (!jwtToken) {
|
if (!jwtToken) {
|
||||||
if (pingInt) {
|
if (pingInt) {
|
||||||
|
|
@ -462,7 +468,7 @@ export default defineBackground(() => {
|
||||||
}
|
}
|
||||||
if (!pingInt) {
|
if (!pingInt) {
|
||||||
pingInt = setInterval(() => {
|
pingInt = setInterval(() => {
|
||||||
void pingJWT(data.settings.ingestPoint);
|
void pingJWT();
|
||||||
}, PING_INT)
|
}, PING_INT)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue