import { LaurelIcon } from "@lume/icons"; import { NostrQuery } from "@lume/system"; import { Spinner } from "@lume/ui"; import * as Switch from "@radix-ui/react-switch"; import { createFileRoute } from "@tanstack/react-router"; import { requestPermission } from "@tauri-apps/plugin-notification"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; export const Route = createFileRoute("/auth/$account/settings")({ beforeLoad: async () => { const settings = await NostrQuery.getSettings(); return { settings }; }, component: Screen, pendingComponent: Pending, }); function Screen() { const navigate = Route.useNavigate(); const { account } = Route.useParams(); const { settings } = Route.useRouteContext(); const { t } = useTranslation(); const [newSettings, setNewSettings] = useState(settings); const [loading, setLoading] = useState(false); const toggleNofitication = async () => { await requestPermission(); setNewSettings((prev) => ({ ...prev, notification: !newSettings.notification, })); }; const toggleAutoUpdate = () => { setNewSettings((prev) => ({ ...prev, autoUpdate: !newSettings.autoUpdate, })); }; const toggleEnhancedPrivacy = () => { setNewSettings((prev) => ({ ...prev, enhancedPrivacy: !newSettings.enhancedPrivacy, })); }; const toggleZap = () => { setNewSettings((prev) => ({ ...prev, zap: !newSettings.zap, })); }; const toggleNsfw = () => { setNewSettings((prev) => ({ ...prev, nsfw: !newSettings.nsfw, })); }; const submit = async () => { try { // start loading setLoading(true); // publish settings const eventId = await NostrQuery.setSettings(newSettings); if (eventId) { return navigate({ to: "/$account/home", params: { account }, replace: true, }); } } catch (e) { setLoading(false); toast.error(e); } }; return (
{t("onboardingSettings.subtitle")}
Enabling push notifications will allow you to receive notifications from Lume.
Lume will display external resources like image, video or link preview as plain text.
Automatically download and install new version.
Show the Zap button in each note and user's profile screen, use for send Bitcoin tip to other users.
By default, Lume will display all content which have Content Warning tag, it's may include NSFW content.