mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
fix: refactor Bilibili header visibility logic
This commit is contained in:
@@ -124,17 +124,6 @@ watch(
|
||||
window.history.replaceState({}, '', url.toString())
|
||||
}
|
||||
|
||||
// Remove the original Bilibili top bar when using original bilibili page to avoid two top bars showing
|
||||
const biliHeader = document.querySelector('.bili-header') as HTMLElement | null
|
||||
if (biliHeader && isSupportedIframePages()) {
|
||||
if (settingsStore.getDockItemIsUseOriginalBiliPage(activatedPage.value) && !isInIframe()) {
|
||||
biliHeader.style.visibility = 'hidden'
|
||||
}
|
||||
else {
|
||||
biliHeader.style.visibility = 'visible'
|
||||
}
|
||||
}
|
||||
|
||||
if (scrollbarRef.value) {
|
||||
const osInstance = scrollbarRef.value.osInstance()
|
||||
osInstance.elements().viewport.scrollTop = 0
|
||||
@@ -144,6 +133,19 @@ watch(
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
watch([() => showTopBar.value, () => activatedPage.value], () => {
|
||||
// Remove the original Bilibili top bar when using original bilibili page to avoid two top bars showing
|
||||
const biliHeader = document.querySelector('.bili-header') as HTMLElement | null
|
||||
if (biliHeader && isHomePage()) {
|
||||
if (settingsStore.getDockItemIsUseOriginalBiliPage(activatedPage.value) && !isInIframe()) {
|
||||
biliHeader.style.visibility = 'hidden'
|
||||
}
|
||||
else {
|
||||
biliHeader.style.visibility = 'visible'
|
||||
}
|
||||
}
|
||||
}, { immediate: true })
|
||||
|
||||
// Setup necessary settings watchers
|
||||
setupNecessarySettingsWatchers()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user