diff --git a/locales/index.d.ts b/locales/index.d.ts index 048f0b54f7..762a863446 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -5409,6 +5409,14 @@ export interface Locale extends ILocale { * リアルタイムモード */ "realtimeMode": string; + /** + * オンにする + */ + "turnItOn": string; + /** + * オフにする + */ + "turnItOff": string; "_chat": { /** * まだメッセージはありません diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index f3c36b74ad..7931d1faef 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1347,6 +1347,8 @@ goToDeck: "デッキへ戻る" federationJobs: "連合ジョブ" driveAboutTip: "ドライブでは、過去にアップロードしたファイルの一覧が表示されます。
\nノートに添付する際に再利用したり、あとで投稿するファイルを予めアップロードしておくこともできます。
\nファイルを削除すると、今までそのファイルを使用した全ての場所(ノート、ページ、アバター、バナー等)からも見えなくなるので注意してください。
\nフォルダを作って整理することもできます。" realtimeMode: "リアルタイムモード" +turnItOn: "オンにする" +turnItOff: "オフにする" _chat: noMessagesYet: "まだメッセージはありません" diff --git a/packages/frontend/src/boot/main-boot.ts b/packages/frontend/src/boot/main-boot.ts index 77cd076c75..ae4e0445db 100644 --- a/packages/frontend/src/boot/main-boot.ts +++ b/packages/frontend/src/boot/main-boot.ts @@ -387,12 +387,6 @@ export async function mainBoot() { // 個人宛てお知らせが発行されたとき main.on('announcementCreated', onAnnouncementCreated); - - // トークンが再生成されたとき - // このままではMisskeyが利用できないので強制的にサインアウトさせる - main.on('myTokenRegenerated', () => { - signout(); - }); } } diff --git a/packages/frontend/src/store.ts b/packages/frontend/src/store.ts index b5ba25be8c..06c2f9149c 100644 --- a/packages/frontend/src/store.ts +++ b/packages/frontend/src/store.ts @@ -82,7 +82,7 @@ export const store = markRaw(new Pizzax('base', { }, realtimeMode: { where: 'device', - default: false, + default: true, }, recentlyUsedEmojis: { where: 'device', diff --git a/packages/frontend/src/ui/_common_/common.vue b/packages/frontend/src/ui/_common_/common.vue index 36e47a020d..373af28747 100644 --- a/packages/frontend/src/ui/_common_/common.vue +++ b/packages/frontend/src/ui/_common_/common.vue @@ -150,12 +150,11 @@ function onNotification(notification: Misskey.entities.Notification, isClient = if ($i) { if (store.s.realtimeMode) { - const connection = useStream().useChannel('main', null, 'UI'); + const connection = useStream().useChannel('main'); connection.on('notification', onNotification); } globalEvents.on('clientNotification', notification => onNotification(notification, true)); - //#region Listen message from SW if ('serviceWorker' in navigator) { swInject(); } diff --git a/packages/frontend/src/ui/_common_/navbar.vue b/packages/frontend/src/ui/_common_/navbar.vue index 27458496f8..d9c9ea48bc 100644 --- a/packages/frontend/src/ui/_common_/navbar.vue +++ b/packages/frontend/src/ui/_common_/navbar.vue @@ -150,8 +150,18 @@ function toggleIconOnly() { } } -function toggleRealtimeMode() { - store.set('realtimeMode', !store.s.realtimeMode); +function toggleRealtimeMode(ev: MouseEvent) { + os.popupMenu([{ + type: 'label', + text: i18n.ts.realtimeMode, + }, { + text: store.s.realtimeMode ? i18n.ts.turnItOff : i18n.ts.turnItOn, + icon: store.s.realtimeMode ? 'ti ti-bolt-off' : 'ti ti-bolt', + action: () => { + store.set('realtimeMode', !store.s.realtimeMode); + window.location.reload(); + }, + }], ev.currentTarget ?? ev.target); } function openAccountMenu(ev: MouseEvent) {