mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
fix: updating themes when installing
This commit is contained in:
parent
22e567466f
commit
c36aff8f62
5 changed files with 16 additions and 6 deletions
1
src/renderer/src/declaration.d.ts
vendored
1
src/renderer/src/declaration.d.ts
vendored
|
@ -29,6 +29,7 @@ import type {
|
||||||
LibraryGame,
|
LibraryGame,
|
||||||
GameRunning,
|
GameRunning,
|
||||||
TorBoxUser,
|
TorBoxUser,
|
||||||
|
Theme,
|
||||||
} from "@types";
|
} from "@types";
|
||||||
import type { AxiosProgressEvent } from "axios";
|
import type { AxiosProgressEvent } from "axios";
|
||||||
import type disk from "diskusage";
|
import type disk from "diskusage";
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { Modal } from "@renderer/components/modal/modal";
|
||||||
import { TextField } from "@renderer/components/text-field/text-field";
|
import { TextField } from "@renderer/components/text-field/text-field";
|
||||||
import { Button } from "@renderer/components/button/button";
|
import { Button } from "@renderer/components/button/button";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import "./modals.scss";
|
|
||||||
import { useUserDetails } from "@renderer/hooks";
|
import { useUserDetails } from "@renderer/hooks";
|
||||||
import { Theme } from "@types";
|
import { Theme } from "@types";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
|
@ -11,6 +10,8 @@ import * as yup from "yup";
|
||||||
import { yupResolver } from "@hookform/resolvers/yup";
|
import { yupResolver } from "@hookform/resolvers/yup";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
|
||||||
|
import "./modals.scss";
|
||||||
|
|
||||||
interface AddThemeModalProps {
|
interface AddThemeModalProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
|
|
|
@ -15,6 +15,14 @@ export const SettingsAppearance = () => {
|
||||||
loadThemes();
|
loadThemes();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const unsubscribe = window.electron.onCssInjected(() => {
|
||||||
|
loadThemes();
|
||||||
|
});
|
||||||
|
|
||||||
|
return () => unsubscribe();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="settings-appearance">
|
<div className="settings-appearance">
|
||||||
<ThemeActions onListUpdated={loadThemes} themesCount={themes.length} />
|
<ThemeActions onListUpdated={loadThemes} themesCount={themes.length} />
|
||||||
|
|
|
@ -86,12 +86,12 @@ export function SettingsRealDebrid() {
|
||||||
<CheckboxField
|
<CheckboxField
|
||||||
label={t("enable_real_debrid")}
|
label={t("enable_real_debrid")}
|
||||||
checked={form.useRealDebrid}
|
checked={form.useRealDebrid}
|
||||||
onChange={() =>
|
onChange={() => {
|
||||||
setForm((prev) => ({
|
setForm((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
useRealDebrid: !form.useRealDebrid,
|
useRealDebrid: !form.useRealDebrid,
|
||||||
}))
|
}));
|
||||||
}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{form.useRealDebrid && (
|
{form.useRealDebrid && (
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
export interface Theme {
|
export interface Theme {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
author: string | undefined;
|
author?: string;
|
||||||
authorName: string | undefined;
|
authorName?: string;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
code: string;
|
code: string;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue