diff --git a/services/web/frontend/js/features/ide-react/connection/connection-manager.ts b/services/web/frontend/js/features/ide-react/connection/connection-manager.ts index e46bfec803..a9990d2558 100644 --- a/services/web/frontend/js/features/ide-react/connection/connection-manager.ts +++ b/services/web/frontend/js/features/ide-react/connection/connection-manager.ts @@ -219,13 +219,15 @@ export class ConnectionManager extends EventTarget { clearInterval(this.idleDisconnectInterval) clearTimeout(this.reconnectCountdownInterval) window.removeEventListener('online', this.onOnline) + + window.setTimeout(() => this.disconnect(), 1000 * delay) + this.changeState({ ...this.state, forceDisconnected: true, forcedDisconnectDelay: delay, error, }) - setTimeout(() => this.disconnect(), 1000) } private onJoinProjectResponse({ diff --git a/services/web/frontend/js/ide/connection/ConnectionManager.js b/services/web/frontend/js/ide/connection/ConnectionManager.js index b0c8fbcfb9..e22c7190d9 100644 --- a/services/web/frontend/js/ide/connection/ConnectionManager.js +++ b/services/web/frontend/js/ide/connection/ConnectionManager.js @@ -253,7 +253,7 @@ export default ConnectionManager = (function () { }) // flush changes before disconnecting this.ide.$scope.$broadcast('flush-changes') - setTimeout(() => this.ide.socket.disconnect(), 1000) + window.setTimeout(() => this.ide.socket.disconnect(), 1000 * delay) this.ide.showLockEditorMessageModal( 'Please wait', `\