Skip to content

Commit 9614f74

Browse files
committed
🎨
1 parent b3c2de2 commit 9614f74

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/frontend/src/pages/settings/privacy.vue

+15-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
4848
<template #label>{{ i18n.ts.lockdown }}<span class="_beta">{{ i18n.ts.beta }}</span></template>
4949

5050
<div class="_gaps_m">
51-
<MkSwitch v-model="requireSigninToViewContents" @update:modelValue="save()">
51+
<MkSwitch :modelValue="requireSigninToViewContents" @update:modelValue="update_requireSigninToViewContents">
5252
{{ i18n.ts._accountSettings.requireSigninToViewContents }}
5353
<template #caption>
5454
<div>{{ i18n.ts._accountSettings.requireSigninToViewContentsDescription1 }}</div>
@@ -172,6 +172,7 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
172172
import FormSlot from '@/components/form/slot.vue';
173173
import { formatDateTimeString } from '@/scripts/format-time-string.js';
174174
import MkInput from '@/components/MkInput.vue';
175+
import * as os from '@/os.js';
175176

176177
const $i = signinRequired();
177178

@@ -217,6 +218,19 @@ watch([makeNotesFollowersOnlyBefore, makeNotesHiddenBefore], () => {
217218
save();
218219
});
219220

221+
async function update_requireSigninToViewContents(value: boolean) {
222+
if (value) {
223+
const { canceled } = await os.confirm({
224+
type: 'warning',
225+
text: i18n.ts.acknowledgeNotesAndEnable,
226+
});
227+
if (canceled) return;
228+
}
229+
230+
requireSigninToViewContents.value = value;
231+
save();
232+
}
233+
220234
function save() {
221235
misskeyApi('i/update', {
222236
isLocked: !!isLocked.value,

0 commit comments

Comments
 (0)