@gxp-dev/tools 2.0.14 → 2.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/lib/tui/App.tsx +24 -21
- package/browser-extensions/firefox/popup.html +478 -519
- package/browser-extensions/firefox/popup.js +444 -500
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +24 -22
- package/dist/tui/App.js.map +1 -1
- package/package.json +1 -1
package/bin/lib/tui/App.tsx
CHANGED
|
@@ -451,30 +451,33 @@ export default function App({ autoStart, args }: AppProps) {
|
|
|
451
451
|
};
|
|
452
452
|
|
|
453
453
|
const addSystemLog = (message: string) => {
|
|
454
|
-
//
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
454
|
+
// Use functional update to properly handle rapid successive calls
|
|
455
|
+
setServices(prev => {
|
|
456
|
+
const existingSystem = prev.find(s => s.id === 'system');
|
|
457
|
+
if (existingSystem) {
|
|
458
|
+
// Add message to existing system service
|
|
459
|
+
return prev.map(s =>
|
|
460
|
+
s.id === 'system' ? { ...s, logs: [...s.logs, message] } : s
|
|
461
|
+
);
|
|
462
|
+
} else {
|
|
463
|
+
// Create new system service with the message
|
|
464
|
+
const newService: Service = {
|
|
465
|
+
id: 'system',
|
|
466
|
+
name: 'System',
|
|
467
|
+
status: 'running',
|
|
468
|
+
logs: [message],
|
|
469
|
+
};
|
|
470
|
+
return [...prev, newService];
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
473
|
|
|
474
474
|
// Switch to system tab
|
|
475
475
|
setTimeout(() => {
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
setServices(current => {
|
|
477
|
+
const sysIdx = current.findIndex(s => s.id === 'system');
|
|
478
|
+
if (sysIdx >= 0) setActiveTab(sysIdx);
|
|
479
|
+
return current; // Don't modify, just read
|
|
480
|
+
});
|
|
478
481
|
}, 50);
|
|
479
482
|
};
|
|
480
483
|
|