Fix bunker UI state management issues (v0.44.5)
Some checks failed
Go / build-and-release (push) Has been cancelled

- Add guard to prevent duplicate service starts
- Fix stale variable references in error handler
- Show token list even when WebSocket temporarily disconnects
- Add logging for bunker service status changes

Files modified:
- app/web/src/BunkerView.svelte: UI state fixes
- app/web/dist/bundle.js: Rebuilt web UI

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
woikos
2025-12-29 15:56:40 +01:00
parent e6fa2f15e4
commit ae024cc784
4 changed files with 17 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -163,6 +163,12 @@
// Start the bunker service
async function startBunkerService() {
// Prevent starting if already active or starting
if (isServiceActive || isStartingService) {
console.log("Service already active or starting, ignoring");
return;
}
if (!userPrivkey || !userPubkey || !bunkerInfo) {
error = "Missing private key or bunker info";
return;
@@ -221,7 +227,10 @@
};
bunkerService.onStatusChange = (status) => {
console.log("[BunkerView] Service status changed:", status);
isServiceActive = status === 'connected';
// Don't clear tokens on disconnect - they're still valid
// Just clear the connected clients list
if (status === 'disconnected') {
connectedClients = [];
}
@@ -240,8 +249,9 @@
error = err.message || "Failed to start bunker service";
bunkerService = null;
isServiceActive = false;
catToken = null;
catTokenEncoded = "";
serviceCatToken = null;
clientTokens = [];
selectedTokenId = null;
} finally {
isStartingService = false;
}
@@ -409,8 +419,8 @@
{/if}
</div>
<!-- Client Tokens Table -->
{#if isServiceActive && clientTokens.length > 0}
<!-- Client Tokens Table - show if tokens exist, even if temporarily disconnected -->
{#if clientTokens.length > 0}
<div class="tokens-section">
<div class="tokens-header">
<h4>Client Tokens</h4>