multimodalart HF Staff commited on
Commit
34f845e
·
verified ·
1 Parent(s): e65c775

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +28 -6
index.html CHANGED
@@ -916,17 +916,39 @@
916
  };
917
 
918
  this.ws.onclose = (event) => {
919
- this.showInfo(`Disconnected: ${event.reason || 'Connection closed'}`);
 
 
920
  this.isGenerating = false;
 
 
 
921
  this.stopFrameExtraction();
922
  this.stopRecording();
923
  this.stopPlaybackLoop();
924
- this.ws = null;
925
- this.updateUI();
926
 
927
- // Update status pill
928
- document.getElementById('statusPill').className = 'status-pill status-disconnected';
929
- document.getElementById('statusPill').textContent = 'Disconnected';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  };
931
 
932
  } catch (error) {
 
916
  };
917
 
918
  this.ws.onclose = (event) => {
919
+ console.log('WebSocket closed:', event.reason);
920
+
921
+ // Force state reset
922
  this.isGenerating = false;
923
+ this.ws = null;
924
+
925
+ // Stop all processes
926
  this.stopFrameExtraction();
927
  this.stopRecording();
928
  this.stopPlaybackLoop();
 
 
929
 
930
+ // Update UI immediately
931
+ const btn = document.getElementById('startStopBtn');
932
+ if (btn) {
933
+ btn.textContent = 'Start Generation';
934
+ btn.className = 'btn btn-primary';
935
+ btn.disabled = false;
936
+ }
937
+
938
+ // Update status
939
+ const statusPill = document.getElementById('statusPill');
940
+ if (statusPill) {
941
+ statusPill.className = 'status-pill status-disconnected';
942
+ statusPill.textContent = 'Disconnected';
943
+ }
944
+
945
+ // Re-enable mode buttons
946
+ ['textModeBtn', 'videoModeBtn', 'webcamModeBtn'].forEach(id => {
947
+ const btn = document.getElementById(id);
948
+ if (btn) btn.disabled = false;
949
+ });
950
+
951
+ this.showInfo(`Disconnected: ${event.reason || 'Generation complete'}`);
952
  };
953
 
954
  } catch (error) {