fix(ui): reconnect after confirming gateway url (#2880) (thanks @0xacb)
This commit is contained in:
parent
85504949a5
commit
8cb0fa993b
@ -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) {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user