@indietabletop/appkit 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -188,16 +188,16 @@ type SafariCheckResult =
|
|
|
188
188
|
| Pending;
|
|
189
189
|
|
|
190
190
|
function useSafariCheck({ performCheck }: { performCheck: boolean }) {
|
|
191
|
-
const
|
|
191
|
+
const isAuthenticated = !!useCurrentUser();
|
|
192
192
|
const isInstalled = useIsInstalled();
|
|
193
193
|
const { dismissedAt, setDismissed } = useInstallPromptState();
|
|
194
194
|
const installedOrDismissed = isInstalled || !!dismissedAt;
|
|
195
195
|
const userAgentResult = useUserAgent({
|
|
196
|
-
performFetch: performCheck && !
|
|
196
|
+
performFetch: performCheck && !isAuthenticated && !installedOrDismissed,
|
|
197
197
|
});
|
|
198
198
|
|
|
199
199
|
const result = useMemo((): SafariCheckResult => {
|
|
200
|
-
return installedOrDismissed || !performCheck
|
|
200
|
+
return isAuthenticated || installedOrDismissed || !performCheck
|
|
201
201
|
? // If the safari prompt was previously dismissed, the app is already
|
|
202
202
|
// installed, or check was disabled explicitly, we skip the prompt.
|
|
203
203
|
new Success({ showPrompt: false })
|
|
@@ -210,7 +210,7 @@ function useSafariCheck({ performCheck }: { performCheck: boolean }) {
|
|
|
210
210
|
isMobile: value.device?.type === "mobile",
|
|
211
211
|
};
|
|
212
212
|
});
|
|
213
|
-
}, [installedOrDismissed, userAgentResult, performCheck]);
|
|
213
|
+
}, [installedOrDismissed, userAgentResult, performCheck, isAuthenticated]);
|
|
214
214
|
|
|
215
215
|
return { result, setDismissed };
|
|
216
216
|
}
|