This commit is contained in:
syuilo 2025-04-29 15:20:34 +09:00
parent 6365e30931
commit 25a4ba935a
6 changed files with 24 additions and 11 deletions

8
locales/index.d.ts vendored
View File

@ -5409,6 +5409,14 @@ export interface Locale extends ILocale {
* *
*/ */
"realtimeMode": string; "realtimeMode": string;
/**
*
*/
"turnItOn": string;
/**
*
*/
"turnItOff": string;
"_chat": { "_chat": {
/** /**
* *

View File

@ -1347,6 +1347,8 @@ goToDeck: "デッキへ戻る"
federationJobs: "連合ジョブ" federationJobs: "連合ジョブ"
driveAboutTip: "ドライブでは、過去にアップロードしたファイルの一覧が表示されます。<br>\nートに添付する際に再利用したり、あとで投稿するファイルを予めアップロードしておくこともできます。<br>\n<b>ファイルを削除すると、今までそのファイルを使用した全ての場所(ノート、ページ、アバター、バナー等)からも見えなくなるので注意してください。</b><br>\nフォルダを作って整理することもできます。" driveAboutTip: "ドライブでは、過去にアップロードしたファイルの一覧が表示されます。<br>\nートに添付する際に再利用したり、あとで投稿するファイルを予めアップロードしておくこともできます。<br>\n<b>ファイルを削除すると、今までそのファイルを使用した全ての場所(ノート、ページ、アバター、バナー等)からも見えなくなるので注意してください。</b><br>\nフォルダを作って整理することもできます。"
realtimeMode: "リアルタイムモード" realtimeMode: "リアルタイムモード"
turnItOn: "オンにする"
turnItOff: "オフにする"
_chat: _chat:
noMessagesYet: "まだメッセージはありません" noMessagesYet: "まだメッセージはありません"

View File

@ -387,12 +387,6 @@ export async function mainBoot() {
// 個人宛てお知らせが発行されたとき // 個人宛てお知らせが発行されたとき
main.on('announcementCreated', onAnnouncementCreated); main.on('announcementCreated', onAnnouncementCreated);
// トークンが再生成されたとき
// このままではMisskeyが利用できないので強制的にサインアウトさせる
main.on('myTokenRegenerated', () => {
signout();
});
} }
} }

View File

@ -82,7 +82,7 @@ export const store = markRaw(new Pizzax('base', {
}, },
realtimeMode: { realtimeMode: {
where: 'device', where: 'device',
default: false, default: true,
}, },
recentlyUsedEmojis: { recentlyUsedEmojis: {
where: 'device', where: 'device',

View File

@ -150,12 +150,11 @@ function onNotification(notification: Misskey.entities.Notification, isClient =
if ($i) { if ($i) {
if (store.s.realtimeMode) { if (store.s.realtimeMode) {
const connection = useStream().useChannel('main', null, 'UI'); const connection = useStream().useChannel('main');
connection.on('notification', onNotification); connection.on('notification', onNotification);
} }
globalEvents.on('clientNotification', notification => onNotification(notification, true)); globalEvents.on('clientNotification', notification => onNotification(notification, true));
//#region Listen message from SW
if ('serviceWorker' in navigator) { if ('serviceWorker' in navigator) {
swInject(); swInject();
} }

View File

@ -150,8 +150,18 @@ function toggleIconOnly() {
} }
} }
function toggleRealtimeMode() { function toggleRealtimeMode(ev: MouseEvent) {
store.set('realtimeMode', !store.s.realtimeMode); 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) { function openAccountMenu(ev: MouseEvent) {