diff --git a/fluxer_app/src/features/voice/engine/media_engine_facade/VoiceSessionRestoreSync.ts b/fluxer_app/src/features/voice/engine/media_engine_facade/VoiceSessionRestoreSync.ts index f08646790..be504fd8d 100644 --- a/fluxer_app/src/features/voice/engine/media_engine_facade/VoiceSessionRestoreSync.ts +++ b/fluxer_app/src/features/voice/engine/media_engine_facade/VoiceSessionRestoreSync.ts @@ -62,10 +62,10 @@ export function saveCurrentVoiceSessionRestoreSnapshot(): void { } export function createVoiceSessionRestoreSync(): VoiceSessionRestoreSyncHandle { - let previousState = readVoiceSessionRestoreSyncState(); + let previousState: VoiceSessionRestoreSyncState | null = null; const syncVoiceSessionRestore = () => { const currentState = readVoiceSessionRestoreSyncState(); - if (areVoiceSessionRestoreSyncStatesEqual(previousState, currentState)) { + if (previousState !== null && areVoiceSessionRestoreSyncStatesEqual(previousState, currentState)) { return; } previousState = currentState;