merge: remove UI for "email notification type" - fixes #855 (!850)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/850

Closes #855

Approved-by: Hazelnoot <acomputerdog@gmail.com>
Approved-by: Marie <github@yuugi.dev>
This commit is contained in:
Marie 2025-01-02 20:11:01 +00:00
commit 6c8d1462c1

View file

@ -19,28 +19,6 @@ SPDX-License-Identifier: AGPL-3.0-only
{{ i18n.ts.receiveAnnouncementFromInstance }}
</MkSwitch>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.emailNotification }}</template>
<div class="_gaps_s">
<MkSwitch v-model="emailNotification_mention">
{{ i18n.ts._notification._types.mention }}
</MkSwitch>
<MkSwitch v-model="emailNotification_reply">
{{ i18n.ts._notification._types.reply }}
</MkSwitch>
<MkSwitch v-model="emailNotification_quote">
{{ i18n.ts._notification._types.quote }}
</MkSwitch>
<MkSwitch v-model="emailNotification_follow">
{{ i18n.ts._notification._types.follow }}
</MkSwitch>
<MkSwitch v-model="emailNotification_receiveFollowRequest">
{{ i18n.ts._notification._types.receiveFollowRequest }}
</MkSwitch>
</div>
</FormSection>
</div>
<div v-if="!instance.enableEmail" class="_gaps_m">
<MkInfo>{{ i18n.ts.emailNotSupported }}</MkInfo>
@ -81,28 +59,6 @@ async function saveEmailAddress() {
});
}
const emailNotification_mention = ref($i.emailNotificationTypes.includes('mention'));
const emailNotification_reply = ref($i.emailNotificationTypes.includes('reply'));
const emailNotification_quote = ref($i.emailNotificationTypes.includes('quote'));
const emailNotification_follow = ref($i.emailNotificationTypes.includes('follow'));
const emailNotification_receiveFollowRequest = ref($i.emailNotificationTypes.includes('receiveFollowRequest'));
const saveNotificationSettings = () => {
misskeyApi('i/update', {
emailNotificationTypes: [
...[emailNotification_mention.value ? 'mention' : null],
...[emailNotification_reply.value ? 'reply' : null],
...[emailNotification_quote.value ? 'quote' : null],
...[emailNotification_follow.value ? 'follow' : null],
...[emailNotification_receiveFollowRequest.value ? 'receiveFollowRequest' : null],
].filter(x => x != null),
});
};
watch([emailNotification_mention, emailNotification_reply, emailNotification_quote, emailNotification_follow, emailNotification_receiveFollowRequest], () => {
saveNotificationSettings();
});
onMounted(() => {
watch(emailAddress, () => {
saveEmailAddress();