@indietabletop/appkit 6.1.0 → 6.1.2

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.
@@ -2,8 +2,8 @@ import { useAppConfig } from "../AppConfig/AppConfig.tsx";
2
2
 
3
3
  export function DocumentTitle(props: { children: string }) {
4
4
  const { children: children } = props;
5
- const { appName, isDev } = useAppConfig();
6
- const itc = `${appName} · Indie Tabletop Club`;
5
+ const { app, isDev } = useAppConfig();
6
+ const itc = `${app.name} · Indie Tabletop Club`;
7
7
  const title = children ? `${children} | ${itc}` : itc;
8
8
 
9
9
  return <title>{isDev ? `[DEV] ${title}` : title}</title>;
@@ -188,16 +188,16 @@ type SafariCheckResult =
188
188
  | Pending;
189
189
 
190
190
  function useSafariCheck({ performCheck }: { performCheck: boolean }) {
191
- const currentUser = useCurrentUser();
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 && !currentUser && !installedOrDismissed,
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indietabletop/appkit",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
4
4
  "description": "A collection of modules used in apps built by Indie Tabletop Club",
5
5
  "private": false,
6
6
  "type": "module",