diff --git a/web/src/components/save/SupportedServices.svelte b/web/src/components/save/SupportedServices.svelte index d3077a2a..6dcb9244 100644 --- a/web/src/components/save/SupportedServices.svelte +++ b/web/src/components/save/SupportedServices.svelte @@ -23,20 +23,26 @@ } }; + const popoverAction = async () => { + expanded = !expanded; + if (expanded && services.length === 0) { + await loadInfo(); + } + if (expanded) { + popover.focus(); + } + } + const showPopover = async () => { - const timeout = renderPopover ? 0 : 10; + const timeout = !renderPopover; renderPopover = true; // 10ms delay to let the popover render for the first time - setTimeout(async () => { - expanded = !expanded; - if (expanded && services.length === 0) { - await loadInfo(); - } - if (expanded) { - popover.focus(); - } - }, timeout); + if (timeout) { + setTimeout(popoverAction, 10); + } else { + await popoverAction(); + } };