fix: updating themes when installing

This commit is contained in:
Chubby Granny Chaser 2025-02-16 04:28:55 +00:00
parent 22e567466f
commit c36aff8f62
No known key found for this signature in database
5 changed files with 16 additions and 6 deletions

View file

@ -29,6 +29,7 @@ import type {
LibraryGame,
GameRunning,
TorBoxUser,
Theme,
} from "@types";
import type { AxiosProgressEvent } from "axios";
import type disk from "diskusage";

View file

@ -2,7 +2,6 @@ import { Modal } from "@renderer/components/modal/modal";
import { TextField } from "@renderer/components/text-field/text-field";
import { Button } from "@renderer/components/button/button";
import { useTranslation } from "react-i18next";
import "./modals.scss";
import { useUserDetails } from "@renderer/hooks";
import { Theme } from "@types";
import { useForm } from "react-hook-form";
@ -11,6 +10,8 @@ import * as yup from "yup";
import { yupResolver } from "@hookform/resolvers/yup";
import { useCallback } from "react";
import "./modals.scss";
interface AddThemeModalProps {
visible: boolean;
onClose: () => void;

View file

@ -15,6 +15,14 @@ export const SettingsAppearance = () => {
loadThemes();
}, []);
useEffect(() => {
const unsubscribe = window.electron.onCssInjected(() => {
loadThemes();
});
return () => unsubscribe();
}, []);
return (
<div className="settings-appearance">
<ThemeActions onListUpdated={loadThemes} themesCount={themes.length} />

View file

@ -86,12 +86,12 @@ export function SettingsRealDebrid() {
<CheckboxField
label={t("enable_real_debrid")}
checked={form.useRealDebrid}
onChange={() =>
onChange={() => {
setForm((prev) => ({
...prev,
useRealDebrid: !form.useRealDebrid,
}))
}
}));
}}
/>
{form.useRealDebrid && (

View file

@ -1,8 +1,8 @@
export interface Theme {
id: string;
name: string;
author: string | undefined;
authorName: string | undefined;
author?: string;
authorName?: string;
isActive: boolean;
code: string;
createdAt: Date;