Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Nov 16, 2024
1 parent b3c2de2 commit 9614f74
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/frontend/src/pages/settings/privacy.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.lockdown }}<span class="_beta">{{ i18n.ts.beta }}</span></template>

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

const $i = signinRequired();

Expand Down Expand Up @@ -217,6 +218,19 @@ watch([makeNotesFollowersOnlyBefore, makeNotesHiddenBefore], () => {
save();
});

async function update_requireSigninToViewContents(value: boolean) {
if (value) {
const { canceled } = await os.confirm({
type: 'warning',
text: i18n.ts.acknowledgeNotesAndEnable,
});
if (canceled) return;
}

requireSigninToViewContents.value = value;
save();
}

function save() {
misskeyApi('i/update', {
isLocked: !!isLocked.value,
Expand Down

0 comments on commit 9614f74

Please sign in to comment.