Merge Dev & Optimize Some Stuff

This commit is contained in:
thororen1234 2025-05-14 14:46:57 -04:00
commit 0fae2ee510
No known key found for this signature in database
16 changed files with 233 additions and 200 deletions

View file

@ -41,7 +41,7 @@ export function VCDonateButton({
);
}
export default function DonateButton({
export function DonateButton({
look = Button.Looks.LINK,
color = Button.Colors.TRANSPARENT,
...props

View file

@ -106,8 +106,6 @@ function Updatable(props: CommonProps) {
const [updates, setUpdates] = React.useState(changes);
const [isChecking, setIsChecking] = React.useState(false);
const [isUpdating, setIsUpdating] = React.useState(false);
const settings = useSettings(["updateRelaunch"]);
const isOutdated = (updates?.length ?? 0) > 0;
return (
@ -119,7 +117,6 @@ function Updatable(props: CommonProps) {
onClick={withDispatcher(setIsUpdating, async () => {
if (await update()) {
setUpdates([]);
if (settings.updateRelaunch) return relaunch();
return await new Promise<void>(r => {
Alerts.show({
title: "Update Success!",
@ -191,7 +188,7 @@ function Newer(props: CommonProps) {
}
function Updater() {
const settings = useSettings(["autoUpdate", "updateRelaunch", "autoUpdateNotification"]);
const settings = useSettings(["autoUpdate", "autoUpdateNotification"]);
const [repo, err, repoPending] = useAwaiter(getRepo, { fallbackValue: "Loading..." });
@ -217,30 +214,12 @@ function Updater() {
</Switch>
<Switch
value={settings.autoUpdateNotification}
onChange={(v: boolean) => {
settings.autoUpdateNotification = v;
if (settings.updateRelaunch) {
settings.updateRelaunch = !v;
}
}}
onChange={(v: boolean) => settings.autoUpdateNotification = v}
note="Shows a notification when Equicord automatically updates"
disabled={!settings.autoUpdate}
>
Get notified when an automatic update completes
</Switch>
<Switch
value={settings.updateRelaunch}
onChange={(v: boolean) => {
settings.updateRelaunch = v;
if (settings.autoUpdateNotification) {
settings.autoUpdateNotification = !v;
}
}}
note="Relaunches the app after updating with no prompt"
disabled={!settings.autoUpdate}
>
Automatically relaunch after updating
</Switch>
<Forms.FormTitle tag="h5">Repo</Forms.FormTitle>

View file

@ -9,7 +9,7 @@ import "./VencordTab.css";
import { openNotificationLogModal } from "@api/Notifications/notificationLog";
import { useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles";
import DonateButton, { InviteButton } from "@components/DonateButton";
import { DonateButton, InviteButton } from "@components/DonateButton";
import { openContributorModal } from "@components/PluginSettings/ContributorModal";
import { openPluginModal } from "@components/PluginSettings/PluginModal";
import { gitRemote } from "@shared/vencordUserAgent";