feat: align with upstream 1.5.9.9

This commit is contained in:
2026-09-12 18:21:11 +08:00
commit 34f0679117
805 changed files with 376275 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
// 微信/QQ 内置浏览器账号密码登录后的绑定引导,仅保存在当前浏览器
const PENDING_KEY = 'voicehub:oauth-bind-reminder-pending'
const DISMISSED_KEY = 'voicehub:oauth-bind-reminder-dismissed'
const getBrowserStorage = () =>
import.meta.client && typeof window !== 'undefined' ? window.localStorage : null
export const useOAuthBindReminder = () => {
const markPasswordLogin = () => {
getBrowserStorage()?.setItem(PENDING_KEY, '1')
}
const hasPendingPasswordLogin = () => getBrowserStorage()?.getItem(PENDING_KEY) === '1'
const clearPending = () => {
getBrowserStorage()?.removeItem(PENDING_KEY)
}
const isDismissed = () => getBrowserStorage()?.getItem(DISMISSED_KEY) === '1'
const dismissForever = () => {
const storage = getBrowserStorage()
storage?.setItem(DISMISSED_KEY, '1')
storage?.removeItem(PENDING_KEY)
}
return {
markPasswordLogin,
hasPendingPasswordLogin,
clearPending,
isDismissed,
dismissForever
}
}