import { useStorage } from "@lume/ark"; import { InfoIcon } from "@lume/icons"; import * as Switch from "@radix-ui/react-switch"; import { isPermissionGranted, requestPermission, } from "@tauri-apps/plugin-notification"; import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; export function OnboardingScreen() { const storage = useStorage(); const navigate = useNavigate(); const [settings, setSettings] = useState({ autoupdate: false, outbox: false, notification: false, }); const next = () => { if (!storage.account.contacts.length) return navigate("/auth/follow"); return navigate("/auth/finish"); }; const toggleOutbox = async () => { await storage.createSetting("outbox", String(+!settings.outbox)); // update state setSettings((prev) => ({ ...prev, outbox: !settings.outbox })); }; const toggleAutoupdate = async () => { await storage.createSetting("autoupdate", String(+!settings.autoupdate)); // update state setSettings((prev) => ({ ...prev, autoupdate: !settings.autoupdate })); }; const toggleNofitication = async () => { await requestPermission(); // update state setSettings((prev) => ({ ...prev, notification: !settings.notification })); }; useEffect(() => { async function loadSettings() { const permissionGranted = await isPermissionGranted(); setSettings((prev) => ({ ...prev, notification: permissionGranted })); const data = await storage.getAllSettings(); if (!data) return; for (const item of data) { if (item.key === "autoupdate") setSettings((prev) => ({ ...prev, autoupdate: !!parseInt(item.value), })); if (item.key === "outbox") setSettings((prev) => ({ ...prev, outbox: !!parseInt(item.value), })); } } loadSettings(); }, []); return (
Keep Lume up to date with latest version, always have new features and bug free.
Enabling push notifications will allow you to receive notifications from Lume directly on your device.
Automatically discover relays to connect based on the preferences of each author.
There are many more settings you can configure from the "Settings" screen. Be sure to visit it later.