Commit 1f89909
authored
fix(cortex-gui): prevent double window on IDE mode startup (#533)
Fixed two related issues in cortex-gui:
1. Double window on startup: When the app was closed while a new window
(created via "New Window") was open, it was saved to window_sessions.json
with a label like "main-xxxxxxxx". On restart, restore_windows() would
recreate this window since it only checked for exact match with "main".
This caused two windows to appear (the default main window from
tauri.conf.json plus the restored main-* window).
2. Infinite loading in IDE mode: Related to the double window issue,
when two windows competed for resources, the file explorer could get
stuck in a loading state.
Fix: Skip restoring windows with labels starting with "main-" during
window restoration. These are temporary additional IDE windows that
users create at runtime and shouldn't persist across restarts.
Auxiliary windows (aux-*) are still restored normally.1 parent a7d236f commit 1f89909
1 file changed
+13
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
207 | 219 | | |
208 | 220 | | |
209 | 221 | | |
210 | 222 | | |
211 | 223 | | |
212 | 224 | | |
| 225 | + | |
213 | 226 | | |
214 | 227 | | |
215 | 228 | | |
| |||
0 commit comments