refactor(privateMode): move option to general tab and requires refresh

This commit is contained in:
オスカー、 2024-07-21 21:13:18 +09:00
parent cee2e5c52f
commit 91bcefaeff
Signed by: SWREI
GPG Key ID: 139D6573F92DA9F7
6 changed files with 63 additions and 57 deletions

View File

@ -152,7 +152,7 @@ const selectedFolders = ref<Misskey.entities.DriveFolder[]>([]);
const uploadings = uploads;
const connection = useStream().useChannel('drive');
const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // $ref使
const hideDriveFileList = ref<boolean>(defaultStore.state.hideSensitiveInformation && defaultStore.state.hideDriveFileList);
const hideDriveFileList = ref<boolean>(defaultStore.state.privateMode && defaultStore.state.hideDriveFileList);
//
const draghover = ref(false);

View File

@ -269,7 +269,7 @@ const isDeleted = ref(false);
const muted = ref(checkMute(appearNote.value, $i?.mutedWords ?? []));
const isRedacted = ref<boolean>(
defaultStore.state.hideDirectMessages &&
defaultStore.state.hideSensitiveInformation &&
defaultStore.state.privateMode &&
note.value.visibility === 'specified'
);
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);

View File

@ -216,6 +216,53 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.hideSensitiveInformation }}</template>
<div class="_gaps_m">
<MkSwitch v-model="privateMode">
{{ i18n.ts._hideSensitiveInformation.use }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.about }}</template>
</MkSwitch>
<MkFolder v-if="privateMode">
<template #label>{{ i18n.ts._hideSensitiveInformation.directMessages }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.directMessagesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.directMessagesDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="privateMode">
<template #label>{{ i18n.ts._hideSensitiveInformation.drive }}</template>
<template v-if="hideDriveFileList" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDriveFileList">
{{ i18n.ts._hideSensitiveInformation.driveUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.driveDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="privateMode && $i?.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.moderationLog }}</template>
<template v-if="hideModerationLog" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideModerationLog">
{{ i18n.ts._hideSensitiveInformation.moderationLogUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.moderationLogDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="privateMode && $i?.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.roles }}</template>
<template v-if="hideRoleList" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideRoleList">
{{ i18n.ts._hideSensitiveInformation.rolesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.rolesDescription }}</template>
</MkSwitch>
</MkFolder>
</div>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.other }}</template>
@ -259,6 +306,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { miLocalStorage } from '@/local-storage.js';
import { globalEvents } from '@/events.js';
import { claimAchievement } from '@/scripts/achievements.js';
import { $i } from '@/account.js';
const lang = ref(miLocalStorage.getItem('lang'));
const fontSize = ref(miLocalStorage.getItem('fontSize'));
@ -322,6 +370,11 @@ const enableHorizontalSwipe = computed(defaultStore.makeGetterSetter('enableHori
const useNativeUIForVideoAudioPlayer = computed(defaultStore.makeGetterSetter('useNativeUIForVideoAudioPlayer'));
const alwaysConfirmFollow = computed(defaultStore.makeGetterSetter('alwaysConfirmFollow'));
const sensitiveDoubleClickRequired = computed(defaultStore.makeGetterSetter('sensitiveDoubleClickRequired'));
const privateMode = computed(defaultStore.makeGetterSetter('privateMode'));
const hideDirectMessages = computed(defaultStore.makeGetterSetter('hideDirectMessages'));
const hideDriveFileList = computed(defaultStore.makeGetterSetter('hideDriveFileList'));
const hideModerationLog = computed(defaultStore.makeGetterSetter('hideModerationLog'));
const hideRoleList = computed(defaultStore.makeGetterSetter('hideRoleList'));
watch(lang, () => {
miLocalStorage.setItem('lang', lang.value as string);
@ -365,6 +418,11 @@ watch([
disableStreamingTimeline,
enableSeasonalScreenEffect,
alwaysConfirmFollow,
privateMode,
hideDirectMessages,
hideDriveFileList,
hideModerationLog,
hideRoleList,
], async () => {
await reloadAsk();
});

View File

@ -67,53 +67,6 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkSwitch v-model="keepCw">{{ i18n.ts.keepCw }}</MkSwitch>
</div>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.hideSensitiveInformation }}</template>
<div class="_gaps_m">
<MkSwitch v-model="hideSensitiveInformation">
{{ i18n.ts._hideSensitiveInformation.use }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.about }}</template>
</MkSwitch>
<MkFolder v-if="hideSensitiveInformation">
<template #label>{{ i18n.ts._hideSensitiveInformation.directMessages }}</template>
<template v-if="hideDirectMessages" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDirectMessages">
{{ i18n.ts._hideSensitiveInformation.directMessagesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.directMessagesDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation">
<template #label>{{ i18n.ts._hideSensitiveInformation.drive }}</template>
<template v-if="hideDriveFileList" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideDriveFileList">
{{ i18n.ts._hideSensitiveInformation.driveUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.driveDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation && $i.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.moderationLog }}</template>
<template v-if="hideModerationLog" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideModerationLog">
{{ i18n.ts._hideSensitiveInformation.moderationLogUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.moderationLogDescription }}</template>
</MkSwitch>
</MkFolder>
<MkFolder v-if="hideSensitiveInformation && $i.isModerator">
<template #label>{{ i18n.ts._hideSensitiveInformation.roles }}</template>
<template v-if="hideRoleList" #suffix>{{ i18n.ts._hideSensitiveInformation.itsHidden }}</template>
<template v-else #suffix>{{ i18n.ts._hideSensitiveInformation.itsNotHidden }}</template>
<MkSwitch v-model="hideRoleList">
{{ i18n.ts._hideSensitiveInformation.rolesUse }}
<template #caption>{{ i18n.ts._hideSensitiveInformation.rolesDescription }}</template>
</MkSwitch>
</MkFolder>
</div>
</FormSection>
</div>
</template>
@ -145,11 +98,6 @@ const defaultNoteVisibility = computed(defaultStore.makeGetterSetter('defaultNot
const defaultNoteLocalOnly = computed(defaultStore.makeGetterSetter('defaultNoteLocalOnly'));
const rememberNoteVisibility = computed(defaultStore.makeGetterSetter('rememberNoteVisibility'));
const keepCw = computed(defaultStore.makeGetterSetter('keepCw'));
const hideSensitiveInformation = computed(defaultStore.makeGetterSetter('hideSensitiveInformation'));
const hideDirectMessages = computed(defaultStore.makeGetterSetter('hideDirectMessages'));
const hideDriveFileList = computed(defaultStore.makeGetterSetter('hideDriveFileList'));
const hideModerationLog = computed(defaultStore.makeGetterSetter('hideModerationLog'));
const hideRoleList = computed(defaultStore.makeGetterSetter('hideRoleList'));
function save() {
misskeyApi('i/update', {

View File

@ -255,8 +255,8 @@ const isEditingMemo = ref(false);
const moderationNote = ref(props.user.moderationNote);
const editModerationNote = ref(false);
const hideModerationNote = !iAmModerator || (defaultStore.state.hideSensitiveInformation && defaultStore.state.hideModerationLog);
const hideRoleList = defaultStore.state.hideSensitiveInformation && defaultStore.state.hideRoleList;
const hideModerationNote = !iAmModerator || (defaultStore.state.privateMode && defaultStore.state.hideModerationLog);
const hideRoleList = defaultStore.state.privateMode && defaultStore.state.hideRoleList;
watch(moderationNote, async () => {
await misskeyApi('admin/update-user-note', { userId: props.user.id, text: moderationNote.value });

View File

@ -156,7 +156,7 @@ export const defaultStore = markRaw(new Storage('base', {
where: 'deviceAccount',
default: false,
},
hideSensitiveInformation: {
privateMode: {
where: 'device',
default: false,
},