Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
- Fix: URLプレビューのプレイヤーをウィンドウで開いたとき、プレイヤーが読み込まれるまでの間 `Invalid URL` と表示される問題を修正
- Fix: 一部の実績が正しく表示されない問題を修正
- Fix: アクセストークン発行時のダイアログのタイトルが「確認コード」となっているのを修正
- Fix: リアルタイム通信の接続が瞬間的に切れすぐに復旧した場合には再接続を促すダイアログが表示されないように
(Cherry-picked from https://github.com/MisskeyIO/misskey/pull/172)

### Server
- Enhance: リモートノートクリーニングジョブのスキップ処理のパフォーマンス改善
Expand Down
15 changes: 12 additions & 3 deletions packages/frontend/src/ui/_common_/stream-indicator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ import { store } from '@/store.js';

const zIndex = os.claimZIndex('high');

const stream = useStream();
const hasDisconnected = ref(false);
let timeoutId: number | null = null;

function onDisconnected() {
hasDisconnected.value = true;
if (timeoutId != null) window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => {
hasDisconnected.value = true;
}, 5000);
}

function resetDisconnected() {
if (timeoutId != null) window.clearTimeout(timeoutId);
hasDisconnected.value = false;
}

Expand All @@ -39,10 +45,13 @@ function reload() {
}

if (store.s.realtimeMode) {
useStream().on('_disconnected_', onDisconnected);
stream.on('_connected_', resetDisconnected);
stream.on('_disconnected_', onDisconnected);

onUnmounted(() => {
useStream().off('_disconnected_', onDisconnected);
if (timeoutId != null) window.clearTimeout(timeoutId);
stream.off('_connected_', resetDisconnected);
stream.off('_disconnected_', onDisconnected);
});
}
</script>
Expand Down
Loading