From 85c9b35d0315a82f03930aa3c665034d4acecba5 Mon Sep 17 00:00:00 2001 From: mattyatea Date: Tue, 26 Sep 2023 10:54:01 +0900 Subject: [PATCH] fix --- packages/frontend/src/components/MkButton.vue | 40 +++++++++++++-- .../src/components/MkCustomEmojiEditLocal.vue | 51 ++++++++++++++++++- packages/frontend/src/ui/_common_/navbar.vue | 4 +- 3 files changed, 87 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/MkButton.vue b/packages/frontend/src/components/MkButton.vue index 2770fdcd7c..379b928477 100644 --- a/packages/frontend/src/components/MkButton.vue +++ b/packages/frontend/src/components/MkButton.vue @@ -20,8 +20,8 @@ SPDX-License-Identifier: AGPL-3.0-only [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, - [$style.gamingDark]: gamingType === 'dark', - [$style.gamingLight]: gamingType === 'light', + [$style.gamingDark]: gaming === 'dark', + [$style.gamingLight]: gaming === 'light', } ]" :type="type" @@ -50,8 +50,8 @@ SPDX-License-Identifier: AGPL-3.0-only [$style.large]: large, [$style.transparent]: transparent, [$style.asLike]: asLike, - [$style.gamingDark]: gamingType === 'dark', - [$style.gamingLight]: gamingType === 'light', + [$style.gamingDark]: gaming === 'dark', + [$style.gamingLight]: gaming === 'light', } ]" :to="to" @@ -90,9 +90,39 @@ const props = defineProps<{ name?: string; value?: string; }>(); +const darkMode = computed(defaultStore.makeGetterSetter('darkMode')); +const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); +// gamingをrefで初期化する +let gaming = ref(''); // 0-off , 1-dark , 2-light -const gamingType = computed(defaultStore.makeGetterSetter('gamingType')); +// gaming.valueに新しい値を代入する +if (darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) { + gaming.value = 'dark'; +} else if (!darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) { + gaming.value = 'light'; +}else{ + gaming.value = ''; +} +watch(darkMode, () => { + if (darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) { + gaming.value = 'dark'; + } else if (!darkMode.value && gamingMode.value && props.primary|| darkMode.value && gamingMode.value && props.gradate) { + gaming.value = 'light'; + }else{ + gaming.value = ''; + } +}) + +watch(gamingMode, () => { + if (darkMode.value && gamingMode.value && props.primary|| darkMode.value && gamingMode.value && props.gradate ) { + gaming.value = 'dark'; + } else if (!darkMode.value && gamingMode.value && props.primary || darkMode.value && gamingMode.value && props.gradate ) { + gaming.value = 'light'; + }else{ + gaming.value = ''; + } +}) const emit = defineEmits<{ (ev: 'click', payload: MouseEvent): void; diff --git a/packages/frontend/src/components/MkCustomEmojiEditLocal.vue b/packages/frontend/src/components/MkCustomEmojiEditLocal.vue index 9f688bc52f..a02702e6bc 100644 --- a/packages/frontend/src/components/MkCustomEmojiEditLocal.vue +++ b/packages/frontend/src/components/MkCustomEmojiEditLocal.vue @@ -13,6 +13,8 @@ Add tag Remove tag Set Lisence + Set isSensitive + Set localOnly Delete @@ -62,7 +64,30 @@ const pagination = { query: (query.value && query.value !== '') ? query.value : null, })), }; - +const setisSensitiveBulk = async () => { + const { canceled, result } = await os.switch1({ + title: 'isSensitive', + type: "mksw" + }); + if (canceled) return; + await os.apiWithDialog('admin/emoji/set-issensitive-bulk', { + ids: selectedEmojis.value, + isSensitive: result + }); + emojisPaginationComponent.value.reload(); +}; +const setlocalOnlyBulk = async () => { + const { canceled, result } = await os.switch1({ + title: 'localOnly', + type: "mksw" + }); + if (canceled) return; + await os.apiWithDialog('admin/emoji/set-localonly-bulk', { + ids: selectedEmojis.value, + localOnly: result + }); + emojisPaginationComponent.value.reload(); +}; const selectAll = () => { if (selectedEmojis.value.length > 0) { selectedEmojis.value = []; @@ -123,6 +148,30 @@ const setLisenceBulk = async () => { emojisPaginationComponent.value.reload(); }; +const isLocalBulk = async () => { + const { canceled, result } = await os.inputText({ + title: 'License', + }); + if (canceled) return; + await os.apiWithDialog('admin/emoji/set-islocal-bulk', { + ids: selectedEmojis.value, + isLocal: result, + }); + emojisPaginationComponent.value.reload(); +}; + +const isSensitiveBulk = async () => { + const { canceled, result } = await os.inputText({ + title: 'License', + }); + if (canceled) return; + await os.apiWithDialog('admin/emoji/set-issensitive-bulk', { + ids: selectedEmojis.value, + license: result, + }); + emojisPaginationComponent.value.reload(); +}; + const addTagBulk = async () => { const { canceled, result } = await os.inputText({ title: 'Tag', diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index d46a19cf66..9c539d8f54 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -111,9 +111,9 @@ document.documentElement.style.setProperty("--localOnlyColor",hexToRgb(defaultSt document.documentElement.style.setProperty('--gamingspeed', defaultStore.state.numberOfGamingSpeed+'s'); const iconOnly = ref(false); -let bannerUrl = ref(defaultStore.state.bannerUrl); +let bannerUrl = computed(defaultStore.makeGetterSetter('bannerUrl')); let iconUrl = ref(); -let gamingType = ref(defaultStore.state.gamingType); +let gamingType = computed(defaultStore.makeGetterSetter('gamingType')); const gamingMode = computed(defaultStore.makeGetterSetter('gamingMode')); const darkMode = computed(defaultStore.makeGetterSetter('darkMode'));