From 33c406771eed288583583baab0c81bddf306392a Mon Sep 17 00:00:00 2001 From: Hakadao Date: Sat, 30 Dec 2023 23:07:38 +0800 Subject: [PATCH 1/2] fix: cannot add video to watch later in moment popup --- src/components/Topbar/components/MomentsPop.vue | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/Topbar/components/MomentsPop.vue b/src/components/Topbar/components/MomentsPop.vue index 26a7099b..148b5d31 100644 --- a/src/components/Topbar/components/MomentsPop.vue +++ b/src/components/Topbar/components/MomentsPop.vue @@ -245,13 +245,6 @@ function pushItemIntoMoments(item: any) { function toggleWatchLater(aid: number) { const isInWatchLater = addedWatchLaterList.includes(aid) - console.log(isInWatchLater) - - // if (isInWatchLater) - // Object.assign(addedWatchLaterList, addedWatchLaterList.filter(item => item !== aid)) - - // else - // addedWatchLaterList.push(aid) if (!isInWatchLater) { browser.runtime.sendMessage({ @@ -271,8 +264,10 @@ function toggleWatchLater(aid: number) { csrf: getCSRF(), }) .then((res) => { - if (res.code === 0) + if (res.code === 0) { + addedWatchLaterList.length = 0 Object.assign(addedWatchLaterList, addedWatchLaterList.filter(item => item !== aid)) + } }) } } @@ -439,7 +434,7 @@ function toggleWatchLater(aid: number) { pos="absolute" duration-300 bg="black opacity-60" rounded="$bew-radius-half" p-1 z-1 - @click.prevent="toggleWatchLater(addedWatchLaterList.includes(moment.aid ?? 0), moment.aid ?? 0)" + @click.prevent="toggleWatchLater(moment.aid ?? 0)" > From 3d4933a1e7786bfcb1f948822239a2e873cc5aee Mon Sep 17 00:00:00 2001 From: Hakadao Date: Sun, 31 Dec 2023 02:17:46 +0800 Subject: [PATCH 2/2] feat: add compatibility page on settings panel --- src/components/Settings/Settings.vue | 9 +++- .../Settings/components/Compatibility.vue | 51 +++++++++++++++++++ src/components/Settings/types.ts | 1 + 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/components/Settings/components/Compatibility.vue diff --git a/src/components/Settings/Settings.vue b/src/components/Settings/Settings.vue index f97c30c4..3bcd3cec 100644 --- a/src/components/Settings/Settings.vue +++ b/src/components/Settings/Settings.vue @@ -5,6 +5,7 @@ import General from './components/General.vue' import Appearance from './components/Appearance.vue' import SearchPage from './components/SearchPage.vue' import Home from './components/Home.vue' +import Compatibility from './components/Compatibility.vue' import About from './components/About.vue' import type { MenuItem } from './types' import { MenuType } from './types' @@ -14,7 +15,7 @@ const emit = defineEmits(['close']) const { t } = useI18n() -const settingsMenu = { General, Appearance, SearchPage, Home, About } +const settingsMenu = { General, Appearance, SearchPage, Home, Compatibility, About } const activatedMenuItem = ref(MenuType.General) const title = ref(t('settings.title')) const preventCloseSettings = ref(false) @@ -56,6 +57,12 @@ const settingsMenuItems = computed((): MenuItem[] => { iconActivated: 'mingcute:home-5-fill', title: t('settings.menu_home'), }, + { + value: MenuType.Compatibility, + icon: 'mingcute:polygon-line', + iconActivated: 'mingcute:polygon-fill', + title: 'Compatibility', + }, { value: MenuType.About, icon: 'mingcute:information-line', diff --git a/src/components/Settings/components/Compatibility.vue b/src/components/Settings/components/Compatibility.vue new file mode 100644 index 00000000..e7a60ea7 --- /dev/null +++ b/src/components/Settings/components/Compatibility.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/src/components/Settings/types.ts b/src/components/Settings/types.ts index 35b244a5..4e77af4c 100644 --- a/src/components/Settings/types.ts +++ b/src/components/Settings/types.ts @@ -3,6 +3,7 @@ export enum MenuType { Appearance = 'Appearance', SearchPage = 'SearchPage', Home = 'Home', + Compatibility = 'Compatibility', About = 'About', }