mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-18 10:04:36 +01:00
(misc) Enable window.startDragging for Tauri
This commit is contained in:
28
src/backend/stores/mihoyo.ts
Normal file
28
src/backend/stores/mihoyo.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { create } from "zustand";
|
||||
import { persist, createJSONStorage } from "zustand/middleware";
|
||||
|
||||
import { invoke } from "@tauri-apps/api";
|
||||
|
||||
export type GenshinStore = {
|
||||
backgroundHash: string;
|
||||
};
|
||||
|
||||
export const useGenshinStore = create(
|
||||
persist(
|
||||
(): GenshinStore => ({
|
||||
backgroundHash: ""
|
||||
}),
|
||||
{
|
||||
name: "genshin",
|
||||
storage: createJSONStorage(() => localStorage)
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
/**
|
||||
* React hook which returns the URL of the locally cached background image.
|
||||
*/
|
||||
export function useBackground() {
|
||||
const { backgroundHash } = useGenshinStore();
|
||||
const [background, setBackground] = useState<string | null>(null);
|
||||
}
|
||||
Reference in New Issue
Block a user