diff --git a/package.json b/package.json index cc85ef0..1180a18 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "6.0.3", + "version": "6.0.4", "license": "BUSL-1.1", "private": true, "packageManager": "pnpm@9.14.4", diff --git a/src/lib/components/ui/player/page.svelte b/src/lib/components/ui/player/page.svelte index 1e3eded..8aba1ff 100644 --- a/src/lib/components/ui/player/page.svelte +++ b/src/lib/components/ui/player/page.svelte @@ -21,22 +21,18 @@
{#if active} {#await active} -
+
{:then mediaInfo} {#if mediaInfo} {:else} -
-
-
+
{/if} {/await} {:else} -
-
-
+
{/if}
diff --git a/src/lib/modules/anilist/client.ts b/src/lib/modules/anilist/client.ts index 6343344..44c3378 100644 --- a/src/lib/modules/anilist/client.ts +++ b/src/lib/modules/anilist/client.ts @@ -239,7 +239,7 @@ class AnilistClient { }) async auth () { - const res = await native.authAL('https://anilist.co/api/v2/oauth/authorize?client_id=3461&response_type=token') + const res = await native.authAL(`https://anilist.co/api/v2/oauth/authorize?client_id=${dev ? 26159 : 3461}&response_type=token`) const token = res.access_token const expires = '' + (Date.now() + (parseInt(res.expires_in) * 1000)) diff --git a/src/lib/modules/irc.ts b/src/lib/modules/irc.ts index 3089d43..85adbda 100644 --- a/src/lib/modules/irc.ts +++ b/src/lib/modules/irc.ts @@ -113,7 +113,7 @@ export default class MessageClient extends EventEmitter { gecos: 'https://kiwiirc.com/', encoding: 'utf8', auto_reconnect: true, - transport: createChannelConstructor(`http${dev ? '' : 's'}://do-e.clients.kiwiirc.com/webirc/kiwiirc/`, '', '1') // this people are dumb enough to not refresh the ssl cert so don't use https + transport: createChannelConstructor('http://do-e.clients.kiwiirc.com/webirc/kiwiirc/', '', '1') // this people are dumb enough to not refresh the ssl cert so don't use https }) }) diff --git a/src/lib/modules/native.ts b/src/lib/modules/native.ts index 4abefaf..f2dedbe 100644 --- a/src/lib/modules/native.ts +++ b/src/lib/modules/native.ts @@ -28,14 +28,19 @@ export default Object.assign>({ return new Promise((resolve, reject) => { const popup = open(url, 'authframe', 'popup') if (!popup) return reject(new Error('Failed to open popup')) - - popup.onload = () => { - if (popup.location.hash.startsWith('#access_token=')) { - const search = Object.fromEntries(new URLSearchParams(popup.location.hash.replace('#', '?')).entries()) as unknown as AuthResponse - resolve(search) - popup.close() - } + const check = () => { + if (popup.closed) return reject(new Error('Popup closed')) + try { + if (popup.location.hash.startsWith('#access_token=')) { + const search = Object.fromEntries(new URLSearchParams(popup.location.hash.replace('#', '?')).entries()) as unknown as AuthResponse + resolve(search) + popup.close() + return + } + } catch (e) {} + setTimeout(check, 100) } + check() }) }, restart: async () => location.reload(),