mirror of
https://github.com/ThaUnknown/miru.git
synced 2026-04-06 20:19:26 +00:00
fix: irc, AL auth, miniplayer loading
This commit is contained in:
parent
cf49796b0b
commit
cb0388fef9
5 changed files with 18 additions and 17 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -21,22 +21,18 @@
|
|||
<div class='w-full {isMiniplayer ? 'z-[49] max-w-80 absolute bottom-4 left-4 md:left-[unset] md:right-4 rounded-lg overflow-clip' : 'h-full'}'>
|
||||
{#if active}
|
||||
{#await active}
|
||||
<div class='w-full flex justify-center items-center bg-black aspect-video cursor-pointer' on:click={openPlayer}>
|
||||
<div class='w-full flex justify-center items-center bg-black {isMiniplayer ? 'aspect-video' : 'h-full' } cursor-pointer' on:click={openPlayer}>
|
||||
<div class='border-[3px] rounded-[50%] w-10 h-10 drop-shadow-lg border-transparent border-t-white animate-spin' />
|
||||
</div>
|
||||
{:then mediaInfo}
|
||||
{#if mediaInfo}
|
||||
<Mediahandler {mediaInfo} />
|
||||
{:else}
|
||||
<div class='w-full flex justify-center items-center bg-black aspect-video cursor-pointer' on:click={openPlayer}>
|
||||
<div class='border-[3px] rounded-[50%] w-10 h-10 drop-shadow-lg border-transparent border-t-white animate-spin' />
|
||||
</div>
|
||||
<div class='w-full flex justify-center items-center bg-black {isMiniplayer ? 'aspect-video' : 'h-full' } cursor-pointer' on:click={openPlayer} />
|
||||
{/if}
|
||||
{/await}
|
||||
{:else}
|
||||
<div class='w-full flex justify-center items-center bg-black aspect-video cursor-pointer' on:click={openPlayer}>
|
||||
<div class='border-[3px] rounded-[50%] w-10 h-10 drop-shadow-lg border-transparent border-t-white animate-spin' />
|
||||
</div>
|
||||
<div class='w-full flex justify-center items-center bg-black {isMiniplayer ? 'aspect-video' : 'h-full' } cursor-pointer' on:click={openPlayer} />
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
})
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -28,14 +28,19 @@ export default Object.assign<Native, Partial<Native>>({
|
|||
return new Promise<AuthResponse>((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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue