import { Refresh } from "@styled-icons/boxicons-regular"; import { useEffect, useState } from "preact/hooks"; import Button from "../../../components/ui/Button"; import Checkbox from "../../../components/ui/Checkbox"; import Tip from "../../../components/ui/Tip"; import CategoryButton from "../../../components/ui/fluent/CategoryButton"; import RLogo from "../assets/revolt_r.svg"; 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); }} description="Launch Revolt when you log into your computer."> Start with computer { window.native.set("discordRPC", discordRPC); setConfig({ ...config, discordRPC, }); }} description="Rep Revolt on your Discord status."> Enable Discord status { const build = nightly ? "nightly" : "stable"; window.native.set("build", build); setHintReload(true); setConfig({ ...config, build, }); }} description="Use the beta branch of Revolt."> Revolt Nightly

Titlebar

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

Advanced

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

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 }> I understand there's no going back.

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