feat(app): default servers on web

This commit is contained in:
adamelmore
2026-01-26 08:15:00 -06:00
parent 0edd304f42
commit 0d651eab3b
5 changed files with 52 additions and 11 deletions
+11 -3
View File
@@ -125,13 +125,21 @@ export function StatusPopover() {
const [defaultServerUrl, setDefaultServerUrl] = createSignal<string | undefined>()
createEffect(() => {
const refreshDefaultServerUrl = () => {
const result = platform.getDefaultServerUrl?.()
if (!result) {
setDefaultServerUrl(undefined)
return
}
if (result instanceof Promise) {
result.then((url) => setDefaultServerUrl(url ? normalizeServerUrl(url) : undefined))
return
}
if (result) setDefaultServerUrl(normalizeServerUrl(result))
setDefaultServerUrl(normalizeServerUrl(result))
}
createEffect(() => {
refreshDefaultServerUrl()
})
return (
@@ -294,7 +302,7 @@ export function StatusPopover() {
<Button
variant="secondary"
class="mt-3 self-start h-8 px-3 py-1.5"
onClick={() => dialog.show(() => <DialogSelectServer />)}
onClick={() => dialog.show(() => <DialogSelectServer />, refreshDefaultServerUrl)}
>
{language.t("status.popover.action.manageServers")}
</Button>