mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: accessKey is still retained when not logged in
This commit is contained in:
@@ -9,10 +9,10 @@ import Anime from './Anime/Anime.vue'
|
||||
import History from './History/History.vue'
|
||||
import Favorites from './Favorites/Favorites.vue'
|
||||
import Video from './Video/Video.vue'
|
||||
import { activatedPage, settings } from '~/logic'
|
||||
import { accessKey, activatedPage, settings } from '~/logic'
|
||||
import '~/styles/index.ts'
|
||||
import { AppPage, LanguageType } from '~/enums/appEnums'
|
||||
import { hexToRGBA } from '~/utils/main'
|
||||
import { getUserID, hexToRGBA } from '~/utils/main'
|
||||
|
||||
const { locale } = useI18n()
|
||||
const [showSettings, toggle] = useToggle(false)
|
||||
@@ -51,6 +51,7 @@ watch(
|
||||
}, 500)
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => settings.value.themeColor,
|
||||
(newValue) => {
|
||||
@@ -65,14 +66,20 @@ watch(
|
||||
|
||||
// Watch for changes in the 'isDark' variable and add the 'dark' class to the 'mainApp' element
|
||||
// to prevent some Unocss dark-specific styles from failing to take effect
|
||||
watch(() => isDark.value, (newValue, oldValue) => {
|
||||
watch(() => isDark.value, () => {
|
||||
setAppAppearance()
|
||||
})
|
||||
|
||||
watch(() => settings.value.language, (newValue, oldValue) => {
|
||||
watch(() => settings.value.language, () => {
|
||||
setAppLanguage()
|
||||
})
|
||||
|
||||
watch(() => accessKey.value, () => {
|
||||
// Clear accessKey if not logged in
|
||||
if (!getUserID())
|
||||
accessKey.value = ''
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
if (/https?:\/\/(www.)?bilibili.com\/video\/.*/.test(location.href))
|
||||
isVideoPage.value = true
|
||||
|
||||
Reference in New Issue
Block a user