mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-03-09 15:40:26 +00:00
lint
This commit is contained in:
parent
d7d88ecb8c
commit
bf3905f19e
5 changed files with 87 additions and 80 deletions
|
@ -4,7 +4,7 @@ import { WindowManager } from "@main/services";
|
||||||
const importTheme = async (
|
const importTheme = async (
|
||||||
_event: Electron.IpcMainInvokeEvent,
|
_event: Electron.IpcMainInvokeEvent,
|
||||||
theme: string,
|
theme: string,
|
||||||
author: string,
|
author: string
|
||||||
) => {
|
) => {
|
||||||
WindowManager.mainWindow?.webContents.send("import-theme", theme, author);
|
WindowManager.mainWindow?.webContents.send("import-theme", theme, author);
|
||||||
};
|
};
|
||||||
|
|
|
@ -92,7 +92,11 @@ const handleDeepLinkPath = (uri?: string) => {
|
||||||
const authorCode = url.searchParams.get("author");
|
const authorCode = url.searchParams.get("author");
|
||||||
|
|
||||||
if (themeName && authorCode) {
|
if (themeName && authorCode) {
|
||||||
WindowManager.mainWindow?.webContents.send("import-theme", themeName, authorCode);
|
WindowManager.mainWindow?.webContents.send(
|
||||||
|
"import-theme",
|
||||||
|
themeName,
|
||||||
|
authorCode
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
|
@ -361,8 +361,11 @@ contextBridge.exposeInMainWorld("electron", {
|
||||||
ipcRenderer.invoke("getCustomThemeById", themeId),
|
ipcRenderer.invoke("getCustomThemeById", themeId),
|
||||||
getActiveCustomTheme: () => ipcRenderer.invoke("getActiveCustomTheme"),
|
getActiveCustomTheme: () => ipcRenderer.invoke("getActiveCustomTheme"),
|
||||||
onImportTheme: (cb: (theme: string, author: string) => void) => {
|
onImportTheme: (cb: (theme: string, author: string) => void) => {
|
||||||
const listener = (_event: Electron.IpcRendererEvent, theme: string, author: string) =>
|
const listener = (
|
||||||
cb(theme, author);
|
_event: Electron.IpcRendererEvent,
|
||||||
|
theme: string,
|
||||||
|
author: string
|
||||||
|
) => cb(theme, author);
|
||||||
ipcRenderer.on("import-theme", listener);
|
ipcRenderer.on("import-theme", listener);
|
||||||
return () => ipcRenderer.removeListener("import-theme", listener);
|
return () => ipcRenderer.removeListener("import-theme", listener);
|
||||||
},
|
},
|
||||||
|
|
|
@ -39,13 +39,13 @@ export interface AppProps {
|
||||||
export function App() {
|
export function App() {
|
||||||
const contentRef = useRef<HTMLDivElement>(null);
|
const contentRef = useRef<HTMLDivElement>(null);
|
||||||
const { updateLibrary, library } = useLibrary();
|
const { updateLibrary, library } = useLibrary();
|
||||||
const [isImportThemeModalVisible, setIsImportThemeModalVisible] = useState(false);
|
const [isImportThemeModalVisible, setIsImportThemeModalVisible] =
|
||||||
|
useState(false);
|
||||||
const [importTheme, setImportTheme] = useState<{
|
const [importTheme, setImportTheme] = useState<{
|
||||||
theme: string;
|
theme: string;
|
||||||
author: string;
|
author: string;
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
|
|
||||||
const { t } = useTranslation("app");
|
const { t } = useTranslation("app");
|
||||||
|
|
||||||
const { updateRepacks } = useRepacks();
|
const { updateRepacks } = useRepacks();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue