fix(ui): reconnect after confirming gateway url (#2880) (thanks @0xacb)

This commit is contained in:
Tyler Yust 2026-01-28 13:26:39 -08:00
parent 85504949a5
commit 8cb0fa993b
3 changed files with 7 additions and 5 deletions

View File

@ -33,7 +33,7 @@ type SettingsHost = {
basePath: string;
themeMedia: MediaQueryList | null;
themeMediaHandler: ((event: MediaQueryListEvent) => void) | null;
pendingGatewayUrl: string | null;
pendingGatewayUrl?: string | null;
};
export function applySettings(host: SettingsHost, next: UiSettings) {

View File

@ -450,12 +450,14 @@ export class MoltbotApp extends LitElement {
}
handleGatewayUrlConfirm() {
if (!this.pendingGatewayUrl) return;
const nextGatewayUrl = this.pendingGatewayUrl;
if (!nextGatewayUrl) return;
this.pendingGatewayUrl = null;
applySettingsInternal(
this as unknown as Parameters<typeof applySettingsInternal>[0],
{ ...this.settings, gatewayUrl: this.pendingGatewayUrl },
{ ...this.settings, gatewayUrl: nextGatewayUrl },
);
this.pendingGatewayUrl = null;
this.connect();
}
handleGatewayUrlCancel() {

View File

@ -7,7 +7,7 @@ export function renderGatewayUrlConfirmation(state: AppViewState) {
if (!pendingGatewayUrl) return nothing;
return html`
<div class="exec-approval-overlay" role="dialog" aria-live="polite">
<div class="exec-approval-overlay" role="dialog" aria-modal="true" aria-live="polite">
<div class="exec-approval-card">
<div class="exec-approval-header">
<div>