Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix[mobile]: push notification dialog wasn't showing (#2903)

Peter Chinman524f8a461328
diff --git a/js/app/packages/core/mobile/IosPushNotificationModal.tsx b/js/app/packages/core/mobile/IosPushNotificationModal.tsx
index b7ee54dd00..6ebcd12604 100644
--- a/js/app/packages/core/mobile/IosPushNotificationModal.tsx
+++ b/js/app/packages/core/mobile/IosPushNotificationModal.tsx
@@ -1,10 +1,10 @@
import { DialogWrapper } from '@core/component/DialogWrapper';
import { isPlatform } from '@core/util/platform';
-import { useIsAuthenticated } from '@queries/auth';
+import { Dialog } from '@kobalte/core/dialog';
import { useNotificationSettings } from '@notifications/notification-settings';
+import { useIsAuthenticated } from '@queries/auth';
import { Button } from '@ui/components/Button';
-import { Dialog } from '@kobalte/core/dialog';
-import { createMemo } from 'solid-js';
+import { createMemo, Show } from 'solid-js';
const DEBUG_FORCE_OPEN = false;
@@ -21,43 +21,45 @@ export function IosPushNotificationModal() {
);
return (
- <Dialog
- open={shouldShow()}
- onOpenChange={(open) => {
- if (!open) settings.dismissPrompt();
- }}
- >
- <Dialog.Portal>
- <DialogWrapper width="90%">
- <div class="flex flex-col gap-4 px-4 py-6">
- <Dialog.Title class="text-lg font-semibold text-ink">
- Enable Push Notifications
- </Dialog.Title>
- <Dialog.Description class="text-sm text-ink-extra-muted">
- Get notified about new messages, mentions, comments, and emails.
- </Dialog.Description>
- <div class="flex gap-2 w-full justify-end pt-2">
- <Dialog.CloseButton class="text-sm text-ink-muted hover:text-ink px-3 py-1.5">
- Later
- </Dialog.CloseButton>
- <Button
- variant="accent"
- size="sm"
- class="text-sm"
- onClick={async () => {
- try {
- await settings.toggle(true);
- } catch (error) {
- console.error('Failed to enable notifications:', error);
- }
- }}
- >
- Enable
- </Button>
+ <Show when={shouldShow()}>
+ <Dialog
+ open={true}
+ onOpenChange={(open) => {
+ if (!open) settings.dismissPrompt();
+ }}
+ >
+ <Dialog.Portal>
+ <DialogWrapper width="90%">
+ <div class="flex flex-col gap-4 px-4 py-6">
+ <Dialog.Title class="text-lg font-semibold text-ink">
+ Enable Push Notifications
+ </Dialog.Title>
+ <Dialog.Description class="text-sm text-ink-extra-muted">
+ Get notified about new messages, mentions, comments, and emails.
+ </Dialog.Description>
+ <div class="flex gap-2 w-full justify-end pt-2">
+ <Dialog.CloseButton class="text-sm text-ink-muted hover:text-ink px-3 py-1.5">
+ Later
+ </Dialog.CloseButton>
+ <Button
+ variant="accent"
+ size="sm"
+ class="text-sm"
+ onClick={async () => {
+ try {
+ await settings.toggle(true);
+ } catch (error) {
+ console.error('Failed to enable notifications:', error);
+ }
+ }}
+ >
+ Enable
+ </Button>
+ </div>
</div>
- </div>
- </DialogWrapper>
- </Dialog.Portal>
- </Dialog>
+ </DialogWrapper>
+ </Dialog.Portal>
+ </Dialog>
+ </Show>
);
}