feat: ability to disable toast
This commit is contained in:
parent
74021dbc55
commit
5048fc7971
6 changed files with 34 additions and 11 deletions
|
@ -32,6 +32,8 @@
|
|||
|
||||
## 細かい変更点
|
||||
|
||||
- 身バレ防止の設定を追加
|
||||
- 「おかえりなさい、◯◯さん」が出ないようにできるように
|
||||
- ユーザーページのデフォルトのタブを「投稿と返信」に変更
|
||||
- タイムラインにリプライを表示する設定をデフォルトで有効に
|
||||
- 未読通知のタブをリアクションの通知を表示するタブに変更
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -1999,3 +1999,5 @@ _emojiModPerm:
|
|||
importZip: ZIPをインポート
|
||||
emojiPackCreator: 絵文字パックの作者
|
||||
exportZip: ZIPをエクスポート
|
||||
privacyForNerds: "身バレ防止"
|
||||
disableToast: "「おかえりなさい、◯◯さん」を表示しない"
|
||||
|
|
|
@ -436,19 +436,21 @@ function checkForSplash() {
|
|||
});
|
||||
}
|
||||
|
||||
const lastUsed = localStorage.getItem("lastUsed");
|
||||
if (lastUsed) {
|
||||
const lastUsedDate = parseInt(lastUsed, 10);
|
||||
// 二時間以上前なら
|
||||
if (Date.now() - lastUsedDate > 1000 * 60 * 60 * 2) {
|
||||
toast(
|
||||
i18n.t("welcomeBackWithName", {
|
||||
name: $i.name || $i.username,
|
||||
}),
|
||||
);
|
||||
if (!defaultStore.state.disableToast) {
|
||||
const lastUsed = localStorage.getItem("lastUsed");
|
||||
if (lastUsed) {
|
||||
const lastUsedDate = parseInt(lastUsed, 10);
|
||||
// 二時間以上前なら
|
||||
if (Date.now() - lastUsedDate > 1000 * 60 * 60 * 2) {
|
||||
toast(
|
||||
i18n.t("welcomeBackWithName", {
|
||||
name: $i.name || $i.username,
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
localStorage.setItem("lastUsed", Date.now().toString());
|
||||
}
|
||||
localStorage.setItem("lastUsed", Date.now().toString());
|
||||
|
||||
const latestDonationInfoShownAt = localStorage.getItem(
|
||||
"latestDonationInfoShownAt",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -373,6 +373,10 @@ export const defaultStore = markRaw(
|
|||
where: "deviceAccount",
|
||||
default: true,
|
||||
},
|
||||
disableToast: {
|
||||
where: "device",
|
||||
default: false,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue