From 4d76243662f0d2b4093ac8a896da4025e688212f Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 14 Apr 2025 15:56:04 +0100 Subject: [PATCH] move cw settings into preferences / "posting form" --- .../src/pages/settings/preferences.vue | 28 +++++++++++++++++++ .../frontend/src/pages/settings/privacy.vue | 25 ----------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/packages/frontend/src/pages/settings/preferences.vue b/packages/frontend/src/pages/settings/preferences.vue index 24b3cac782..519ce6db2f 100644 --- a/packages/frontend/src/pages/settings/preferences.vue +++ b/packages/frontend/src/pages/settings/preferences.vue @@ -385,6 +385,24 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + + + + + + + + + + + + + @@ -902,6 +920,7 @@ import FormSection from '@/components/form/section.vue'; import FormLink from '@/components/form/link.vue'; import MkLink from '@/components/MkLink.vue'; import MkInfo from '@/components/MkInfo.vue'; +import MkInput from '@/components/MkInput.vue'; import { store } from '@/store.js'; import * as os from '@/os.js'; import { misskeyApi } from '@/utility/misskey-api.js'; @@ -1004,6 +1023,8 @@ const numberOfReplies = prefer.model('numberOfReplies'); const autoloadConversation = prefer.model('autoloadConversation'); const clickToOpen = prefer.model('clickToOpen'); const useCustomSearchEngine = computed(() => !Object.keys(searchEngineMap).includes(searchEngine.value)); +const defaultCW = ref($i.defaultCW); +const defaultCWPriority = ref($i.defaultCWPriority); watch(lang, () => { miLocalStorage.setItem('lang', lang.value as string); @@ -1187,6 +1208,13 @@ async function testNotificationDot() { } } +function save() { + misskeyApi('i/update', { + defaultCWPriority: defaultCWPriority.value, + defaultCW: defaultCW.value, + }); +} + const headerActions = computed(() => []); const headerTabs = computed(() => []); diff --git a/packages/frontend/src/pages/settings/privacy.vue b/packages/frontend/src/pages/settings/privacy.vue index dcad6a13d4..4d196dbb8f 100644 --- a/packages/frontend/src/pages/settings/privacy.vue +++ b/packages/frontend/src/pages/settings/privacy.vue @@ -219,26 +219,6 @@ SPDX-License-Identifier: AGPL-3.0-only - -
- {{ i18n.ts.keepCw }} - - - - - - - - - - - - - - -
-
- {{ i18n.ts._accountSettings.mayNotEffectSomeSituations }} @@ -285,8 +265,6 @@ const publicReactions = ref($i.publicReactions); const followingVisibility = ref($i.followingVisibility); const followersVisibility = ref($i.followersVisibility); const chatScope = ref($i.chatScope); -const defaultCW = ref($i.defaultCW); -const defaultCWPriority = ref($i.defaultCWPriority); const allowUnsignedFetch = ref($i.allowUnsignedFetch); const computedAllowUnsignedFetch = computed(() => { if (allowUnsignedFetch.value !== 'staff') { @@ -294,7 +272,6 @@ const computedAllowUnsignedFetch = computed(() => { } return instance.allowUnsignedFetch; }); -const keepCw = prefer.model('keepCw'); const makeNotesFollowersOnlyBefore_type = computed(() => { if (makeNotesFollowersOnlyBefore.value == null) { @@ -350,8 +327,6 @@ function save() { followingVisibility: followingVisibility.value, followersVisibility: followersVisibility.value, chatScope: chatScope.value, - defaultCWPriority: defaultCWPriority.value, - defaultCW: defaultCW.value, allowUnsignedFetch: allowUnsignedFetch.value, }); }