forked from FoundKeyGang/FoundKey
remove 'welcome back' toast
Defining an entirely new component and localStorage key for this seems kind of overkill for such a feature. IMHO it is also a bit annoying.
This commit is contained in:
parent
2a7e278565
commit
dc63a7b04e
17 changed files with 1 additions and 99 deletions
|
@ -785,7 +785,6 @@ voteConfirm: "متيقِّن من تصويتك لـ {choice}؟"
|
|||
hide: "إخفاء"
|
||||
leaveGroup: "مغادرة الفريق"
|
||||
leaveGroupConfirm: "متيقن من مغادرة \"{name}\"؟"
|
||||
welcomeBackWithName: "مرحبًا بك مجددًا {name}"
|
||||
clickToFinishEmailVerification: "انقر [{ok}] لاستيثاق بريدك الإلكتروني."
|
||||
overridedDeviceKind: "نوع الجهاز"
|
||||
smartphone: "هاتف ذكي"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "লুকান"
|
|||
leaveGroup: "গ্রুপ ছেড়ে চলে যান"
|
||||
leaveGroupConfirm: "\"{name}\" গ্রুপ ছেড়ে চলে যেতে চান?"
|
||||
useDrawerReactionPickerForMobile: "মোবাইলে রিঅ্যাকশন পিকারকে ড্রয়ারে প্রদর্শন করুন"
|
||||
welcomeBackWithName: "আবার স্বাগতম, {name}"
|
||||
clickToFinishEmailVerification: " [{ok}] ক্লিক করার মাধ্যমে আপনার ইমেল ঠিকানা নিশ্চিত করুন।"
|
||||
overridedDeviceKind: "ডিভাইসের ধরন"
|
||||
smartphone: "স্মার্টফোন"
|
||||
|
|
|
@ -821,7 +821,6 @@ hide: "Inhalt verbergen"
|
|||
leaveGroup: "Gruppe verlassen"
|
||||
leaveGroupConfirm: "Möchtest du „{name}“ wirklich verlassen?"
|
||||
useDrawerReactionPickerForMobile: "Auf mobilen Geräten ausfahrbare Reaktionsauswahl anzeigen"
|
||||
welcomeBackWithName: "Willkommen zurück, {name}"
|
||||
clickToFinishEmailVerification: "Drücke bitte auf [{ok}], um die Email-Bestätigung abzuschließen."
|
||||
overridedDeviceKind: "Gerätetyp"
|
||||
smartphone: "Smartphone"
|
||||
|
|
|
@ -821,7 +821,6 @@ hide: "Hide"
|
|||
leaveGroup: "Leave group"
|
||||
leaveGroupConfirm: "Are you sure you want to leave \"{name}\"?"
|
||||
useDrawerReactionPickerForMobile: "Display reaction picker as drawer on mobile"
|
||||
welcomeBackWithName: "Welcome back, {name}"
|
||||
clickToFinishEmailVerification: "Please click [{ok}] to complete email verification."
|
||||
overridedDeviceKind: "Device type"
|
||||
smartphone: "Smartphone"
|
||||
|
|
|
@ -814,7 +814,6 @@ voteConfirm: "Confirmez-vous votre vote pour « {choice} » ?"
|
|||
hide: "Masquer"
|
||||
leaveGroup: "Quitter le groupe"
|
||||
leaveGroupConfirm: "Êtes vous sûr de vouloir quitter \"{name}\" ?"
|
||||
welcomeBackWithName: "Heureux de vous revoir, {name}"
|
||||
clickToFinishEmailVerification: "Veuillez cliquer sur [{ok}] afin de compléter la vérification par courriel."
|
||||
overridedDeviceKind: "Type d’appareil"
|
||||
smartphone: "Smartphone"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "Sembunyikan"
|
|||
leaveGroup: "Keluar grup"
|
||||
leaveGroupConfirm: "Apakah kamu yakin untuk keluar dari \"{name}\"?"
|
||||
useDrawerReactionPickerForMobile: "Tampilkan bilah reaksi sebagai laci di ponsel"
|
||||
welcomeBackWithName: "Selamat datang kembali, {name}."
|
||||
clickToFinishEmailVerification: "Mohon klik [{ok}] untuk menyelesaikan verifikasi email."
|
||||
overridedDeviceKind: "Tipe perangkat"
|
||||
smartphone: "Ponsel"
|
||||
|
|
|
@ -800,7 +800,6 @@ hide: "Nascondere"
|
|||
leaveGroup: "Esci dal gruppo"
|
||||
leaveGroupConfirm: "Uscire da「{name}」?"
|
||||
useDrawerReactionPickerForMobile: "Mostra sul drawer da dispositivo mobile"
|
||||
welcomeBackWithName: "Bentornato/a, {name}"
|
||||
clickToFinishEmailVerification: "Fai click su [{ok}] per completare la verifica dell'indirizzo email."
|
||||
indefinitely: "Non scade"
|
||||
tenMinutes: "10 minuti"
|
||||
|
|
|
@ -823,7 +823,6 @@ hide: "隠す"
|
|||
leaveGroup: "グループから抜ける"
|
||||
leaveGroupConfirm: "「{name}」から抜けますか?"
|
||||
useDrawerReactionPickerForMobile: "モバイルデバイスのときドロワーで表示"
|
||||
welcomeBackWithName: "おかえりなさい、{name}さん"
|
||||
clickToFinishEmailVerification: "[{ok}]を押して、メールアドレスの確認を完了してください。"
|
||||
overridedDeviceKind: "デバイスタイプ"
|
||||
smartphone: "スマートフォン"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "숨기기"
|
|||
leaveGroup: "그룹 나가기"
|
||||
leaveGroupConfirm: "\"{name}\"에서 나갈까요?"
|
||||
useDrawerReactionPickerForMobile: "모바일에서 드로어 메뉴로 표시"
|
||||
welcomeBackWithName: "환영합니다, {name}님"
|
||||
clickToFinishEmailVerification: "[{ok}]를 눌러 이메일 인증을 완료하세요."
|
||||
overridedDeviceKind: "장치 유형"
|
||||
smartphone: "스마트폰"
|
||||
|
|
|
@ -818,7 +818,6 @@ hide: "Спрятать"
|
|||
leaveGroup: "Покинуть группу"
|
||||
leaveGroupConfirm: "Покинуть группу «{name}»?"
|
||||
useDrawerReactionPickerForMobile: "Выдвижная палитра на мобильном устройстве"
|
||||
welcomeBackWithName: "С возвращением, {name}!"
|
||||
clickToFinishEmailVerification: "Пожалуйста, нажмите [{ok}], чтобы завершить подтверждение адреса электронной почты."
|
||||
overridedDeviceKind: "Тип устройства"
|
||||
smartphone: "Смартфон"
|
||||
|
|
|
@ -819,7 +819,6 @@ hide: "Skryť"
|
|||
leaveGroup: "Opustiť skupiny"
|
||||
leaveGroupConfirm: "Naozaj chcete opustiť \"{name}\"?"
|
||||
useDrawerReactionPickerForMobile: "Zobraziť výber reakcií ako šuflík na mobile"
|
||||
welcomeBackWithName: "Vitajte späť, {name}"
|
||||
clickToFinishEmailVerification: "Kliknutím na [{ok}] dokončíte overeniu emailu."
|
||||
overridedDeviceKind: "Typ zariadenia"
|
||||
smartphone: "Smartfón"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "Ẩn"
|
|||
leaveGroup: "Rời khỏi nhóm"
|
||||
leaveGroupConfirm: "Bạn có chắc muốn rời khỏi nhóm \"{name}\"?"
|
||||
useDrawerReactionPickerForMobile: "Hiện bộ chọn biểu cảm dạng xổ ra trên điện thoại"
|
||||
welcomeBackWithName: "Chào mừng trở lại, {name}"
|
||||
clickToFinishEmailVerification: "Vui lòng nhấn [{ok}] để hoàn tất việc đăng ký."
|
||||
overridedDeviceKind: "Loại thiết bị"
|
||||
smartphone: "Điện thoại"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "隐藏"
|
|||
leaveGroup: "离开群组"
|
||||
leaveGroupConfirm: "确定离开「{name}」?"
|
||||
useDrawerReactionPickerForMobile: "在移动设备上使用抽屉显示"
|
||||
welcomeBackWithName: "欢迎回来,{name}"
|
||||
clickToFinishEmailVerification: "点击 [{ok}] 完成电子邮件地址认证。"
|
||||
overridedDeviceKind: "设备类型"
|
||||
smartphone: "智能手机"
|
||||
|
|
|
@ -820,7 +820,6 @@ hide: "隱藏"
|
|||
leaveGroup: "離開群組"
|
||||
leaveGroupConfirm: "確定離開「{name}」?"
|
||||
useDrawerReactionPickerForMobile: "在移動設備上使用抽屜顯示"
|
||||
welcomeBackWithName: "歡迎回來,{name}"
|
||||
clickToFinishEmailVerification: "點擊 [{ok}] 完成電子郵件地址認證。"
|
||||
overridedDeviceKind: "裝置類型"
|
||||
smartphone: "智慧型手機"
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
<template>
|
||||
<div class="mk-toast">
|
||||
<transition :name="$store.state.animation ? 'toast' : ''" appear @after-leave="emit('closed')">
|
||||
<div v-if="showing" class="body _acrylic" :style="{ zIndex }">
|
||||
<div class="message">
|
||||
{{ message }}
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import * as os from '@/os';
|
||||
|
||||
defineProps<{
|
||||
message: string;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'closed'): void;
|
||||
}>();
|
||||
|
||||
const zIndex = os.claimZIndex('high');
|
||||
let showing = $ref(true);
|
||||
|
||||
onMounted(() => {
|
||||
window.setTimeout(() => {
|
||||
showing = false;
|
||||
}, 4000);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.toast-enter-active, .toast-leave-active {
|
||||
transition: opacity 0.3s, transform 0.3s !important;
|
||||
}
|
||||
.toast-enter-from, .toast-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(-100%);
|
||||
}
|
||||
|
||||
.mk-toast {
|
||||
> .body {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
margin: 0 auto;
|
||||
margin-top: 16px;
|
||||
min-width: 300px;
|
||||
max-width: calc(100% - 32px);
|
||||
width: min-content;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 8px;
|
||||
overflow: clip;
|
||||
text-align: center;
|
||||
pointer-events: none;
|
||||
|
||||
> .message {
|
||||
padding: 16px 24px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -24,7 +24,7 @@ import { version, ui, lang, host } from '@/config';
|
|||
import { applyTheme } from '@/scripts/theme';
|
||||
import { isDeviceDarkmode } from '@/scripts/is-device-darkmode';
|
||||
import { i18n } from '@/i18n';
|
||||
import { confirm, alert, post, popup, toast } from '@/os';
|
||||
import { confirm, alert, post, popup } from '@/os';
|
||||
import { stream } from '@/stream';
|
||||
import * as sound from '@/scripts/sound';
|
||||
import { $i, refreshAccount, login, updateAccount, signout } from '@/account';
|
||||
|
@ -348,18 +348,6 @@ import { getAccountFromId } from '@/scripts/get-account-from-id';
|
|||
});
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
if ('Notification' in window) {
|
||||
// 許可を得ていなかったらリクエスト
|
||||
if (Notification.permission === 'default') {
|
||||
|
|
|
@ -198,12 +198,6 @@ export function modalPageWindow(path: string) {
|
|||
}, {}, 'closed');
|
||||
}
|
||||
|
||||
export function toast(message: string) {
|
||||
popup(defineAsyncComponent(() => import('@/components/toast.vue')), {
|
||||
message,
|
||||
}, {}, 'closed');
|
||||
}
|
||||
|
||||
export function alert(props: {
|
||||
type?: 'error' | 'info' | 'success' | 'warning' | 'waiting' | 'question';
|
||||
title?: string | null;
|
||||
|
|
Loading…
Reference in a new issue