import { Refresh } from "@styled-icons/boxicons-regular"; import { useEffect, useState } from "preact/hooks"; import { Button, Checkbox, Tip } from "@revoltchat/ui"; import RLogo from "../assets/revolt_r.svg"; import CategoryButton from "../../../components/ui/fluent/CategoryButton"; export function Native() { if (typeof window.native === "undefined") return null; /* eslint-disable react-hooks/rules-of-hooks */ const [config, setConfig] = useState(window.native.getConfig()); const [autoStart, setAutoStart] = useState(); const fetchValue = () => window.native.getAutoStart().then(setAutoStart); const [hintReload, setHintReload] = useState(false); const [hintRelaunch, setHintRelaunch] = useState(false); const [confirmDev, setConfirmDev] = useState(false); useEffect(() => { fetchValue(); }, []); return (
Some options might require a restart.

App Behavior

{ if (v) { await window.native.enableAutoStart(); } else { await window.native.disableAutoStart(); } setAutoStart(v); }} title="Start with computer" description="Launch Revolt when you log into your computer." /> { window.native.set("minimiseToTray", minimiseToTray); setConfig({ ...config, minimiseToTray, }); }} title="Minimise to Tray" description="Instead of closing, Revolt will hide in your tray." /> { window.native.set("discordRPC", discordRPC); setConfig({ ...config, discordRPC, }); }} title="Enable Discord status" description="Rep Revolt on your Discord status." /> { const build = nightly ? "nightly" : "stable"; window.native.set("build", build); setHintReload(true); setConfig({ ...config, build, }); }} title="Revolt Nightly" description="Use the beta branch of Revolt." />

Titlebar

{ window.native.set("frame", !frame); setHintRelaunch(true); setConfig({ ...config, frame: !frame, }); }} title="Custom window frame" description="Let Revolt use its own window frame." /> { window.native.set("frame", !frame); setHintRelaunch(true); setConfig({ ...config, frame: !frame, }); }} title="Enable quick action buttons" description="Show mute/deafen buttons on the titlebar." />

Advanced

{ window.native.set( "hardwareAcceleration", hardwareAcceleration, ); setHintRelaunch(true); setConfig({ ...config, hardwareAcceleration, }); }} title="Hardware Acceleration" description="Uses your GPU to render the app, disable if you run into visual issues." />

Local Development Mode

{config.build === "dev" ? ( <>
Development mode is currently on.
) : ( <> This will change the app to the 'dev' branch, instead loading the app from a local server on your machine.
Without a server running,{" "} the app will not load!
yarn dev --port 3001 } />

)}
} description={version {window.nativeVersion}} action={}> Revolt for Desktop
); }