diff --git a/src/contentScripts/views/App.vue b/src/contentScripts/views/App.vue index 6f37d41e..8347a14a 100644 --- a/src/contentScripts/views/App.vue +++ b/src/contentScripts/views/App.vue @@ -14,7 +14,7 @@ import Video from './Video/Video.vue' import { accessKey, activatedPage, settings } from '~/logic' import '~/styles/index.ts' import { AppPage, LanguageType } from '~/enums/appEnums' -import { getUserID, hexToRGBA } from '~/utils/main' +import { getUserID, hexToRGBA, smoothScrollToTop } from '~/utils/main' import emitter from '~/utils/mitt' const { locale } = useI18n() @@ -37,6 +37,7 @@ const isVideoPage = ref(false) const mainAppRef = ref() as Ref const mainAppOpacity = ref(0) const showTopbarMask = ref(false) +const dynamicCompoentKey = ref(Number(new Date())) const tooltipPlacement = computed(() => { if (settings.value.dockPosition === 'left') @@ -211,6 +212,14 @@ function setAppWallpaperMaskingOpacity() { else bewlyElement.style.setProperty('--bew-bg-mask-opacity', `${settings.value.wallpaperMaskOpacity}%`) } + +function handleRefresh() { + dynamicCompoentKey.value = Number(new Date()) +} + +function handleBackToTop() { + smoothScrollToTop(mainAppRef.value, 300) +}