feat: ability to disable toast

This commit is contained in:
naskya 2023-09-15 01:17:14 +09:00
parent 74021dbc55
commit 5048fc7971
Signed by: naskya
GPG key ID: 164DFF24E2D40139
6 changed files with 34 additions and 11 deletions

View file

@ -32,6 +32,8 @@
## 細かい変更点
- 身バレ防止の設定を追加
- 「おかえりなさい、◯◯さん」が出ないようにできるように
- ユーザーページのデフォルトのタブを「投稿と返信」に変更
- タイムラインにリプライを表示する設定をデフォルトで有効に
- 未読通知のタブをリアクションの通知を表示するタブに変更

View file

@ -2144,3 +2144,5 @@ _emojiModPerm:
add: "Add"
mod: "Add and Edit"
full: "Allow All"
privacyForNerds: "Privacy protection in public places"
disableToast: "Don't show the \"Welcome back\" banner"

View file

@ -1999,3 +1999,5 @@ _emojiModPerm:
importZip: ZIPをインポート
emojiPackCreator: 絵文字パックの作者
exportZip: ZIPをエクスポート
privacyForNerds: "身バレ防止"
disableToast: "「おかえりなさい、◯◯さん」を表示しない"

View file

@ -436,6 +436,7 @@ function checkForSplash() {
});
}
if (!defaultStore.state.disableToast) {
const lastUsed = localStorage.getItem("lastUsed");
if (lastUsed) {
const lastUsedDate = parseInt(lastUsed, 10);
@ -449,6 +450,7 @@ function checkForSplash() {
}
}
localStorage.setItem("lastUsed", Date.now().toString());
}
const latestDonationInfoShownAt = localStorage.getItem(
"latestDonationInfoShownAt",

View file

@ -262,6 +262,16 @@
>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.privacyForNerds }}</template>
<FormSwitch v-model="disableToast" class="_formBlock"
>{{ i18n.ts.disableToast
}}<span class="_beta">{{
i18n.ts.originalFeature
}}</span></FormSwitch
>
</FormSection>
<FormSection>
<template #label>{{ i18n.ts.forMobile }}</template>
<FormSwitch
@ -439,6 +449,7 @@ const showBigPostButton = computed(
const emphasizeFollowed = computed(
defaultStore.makeGetterSetter("emphasizeFollowed"),
);
const disableToast = computed(defaultStore.makeGetterSetter("disableToast"));
watch(swipeOnDesktop, () => {
defaultStore.set("swipeOnMobile", true);

View file

@ -373,6 +373,10 @@ export const defaultStore = markRaw(
where: "deviceAccount",
default: true,
},
disableToast: {
where: "device",
default: false,
},
}),
);