feat: harden public install guide loading
This commit is contained in:
+10
-1
@@ -1064,6 +1064,15 @@
|
||||
openExternalLink(url);
|
||||
}
|
||||
|
||||
function openPublicConnectLink() {
|
||||
const url = publicInstallSubscription?.connect_url || publicInstallSubscription?.config_link;
|
||||
if (!url) {
|
||||
showToast(t("wa_connect_link_unavailable"));
|
||||
return;
|
||||
}
|
||||
openExternalLink(url);
|
||||
}
|
||||
|
||||
function openInstallOrConnect() {
|
||||
if (canUseInstallGuides()) {
|
||||
goInstall();
|
||||
@@ -1363,7 +1372,7 @@
|
||||
user={{}}
|
||||
subscription={publicInstallSubscription || { install_share_token: publicInstallToken }}
|
||||
{goHome}
|
||||
{openConnectLink}
|
||||
openConnectLink={openPublicConnectLink}
|
||||
{openExternalLink}
|
||||
{copyText}
|
||||
{t}
|
||||
|
||||
@@ -21,7 +21,12 @@ export function createInstallGuidesStore({ api, t, showToast }) {
|
||||
});
|
||||
if (!force && snapshot?.loaded) return snapshot;
|
||||
const promise = (async () => {
|
||||
state.update((s) => ({ ...s, loading: true, error: "" }));
|
||||
state.update((s) => ({
|
||||
...s,
|
||||
loading: true,
|
||||
loaded: force ? false : s.loaded,
|
||||
error: "",
|
||||
}));
|
||||
try {
|
||||
const response = await api(path);
|
||||
const next = {
|
||||
|
||||
Reference in New Issue
Block a user