mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: the language cannot be updated on first load
This commit is contained in:
@@ -21,7 +21,7 @@ watch(() => activatedPage.value, (newValue, oldValue) => {
|
||||
window.scrollTo({ top: 0, behavior: 'smooth' })
|
||||
})
|
||||
|
||||
window.onload = async () => {
|
||||
onUpdated(async () => {
|
||||
// if there is first-time load extension, set the default language by browser display language
|
||||
if (!language.value) {
|
||||
if (browser.i18n.getUILanguage() === 'zh-CN') {
|
||||
@@ -41,7 +41,7 @@ window.onload = async () => {
|
||||
}
|
||||
|
||||
locale.value = language.value
|
||||
}
|
||||
})
|
||||
|
||||
function changeActivatePage(pageName: AppPage) {
|
||||
activatedPage.value = pageName
|
||||
|
||||
Reference in New Issue
Block a user