openGym · {t('free & open source (AGPL v3)')}
@@ -154,6 +167,40 @@ export default function Settings() {
}
function NotificationsCard({ S, update, toast }) {
+ if (MOBILE) return
+ return
+}
+
+// Mobile build: the reminder is a native local notification scheduled on planned weekdays —
+// no push server involved. The schedule itself is (re)synced by the store on every persist;
+// this card only owns the OS permission prompt when the switch turns on.
+function MobileReminderCard({ S, update, toast }) {
+ const setReminder = patch => update(s => { s.reminder = { ...(s.reminder || DEF.reminder), ...patch, tz: localTZ() } })
+ const toggle = async () => {
+ const on = !S.reminder?.on
+ if (on) {
+ const ok = await syncReminder({ ...S, reminder: { ...(S.reminder || DEF.reminder), on: true } }, true)
+ if (!ok) { toast(t('Could not change notification settings')); return }
+ }
+ setReminder({ on })
+ }
+ return (
+
+ )
+}
+
+function PushCard({ S, update, toast }) {
const [on, setOn] = useState(false)
const [busy, setBusy] = useState(false)
const supported = pushSupported()