From 63558e9421a3b7f8c69fe4c9fbacf3efb71661bd Mon Sep 17 00:00:00 2001 From: sugoidogo Date: Sat, 18 Jan 2025 12:54:55 +0000 Subject: [PATCH] fix again --- static/TwitchAuth-localforage.mjs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/TwitchAuth-localforage.mjs b/static/TwitchAuth-localforage.mjs index 3a4c3d8..2f79c9b 100644 --- a/static/TwitchAuth-localforage.mjs +++ b/static/TwitchAuth-localforage.mjs @@ -189,7 +189,10 @@ export default class TwitchAuth { * get the cached token * @returns {Promise} */ - async getLocalToken(user_id=await localStorage.key(0)){ + async getLocalToken(user_id){ + if(!user_id){ + user_id=await localStorage.key(0) + } const data=await localStorage.getItem(user_id)||globalThis.localStorage.getItem(import.meta.url) if(!data){ return null