(misc) Enable window.startDragging for Tauri

This commit is contained in:
KingRainbow44
2023-11-23 14:00:00 +01:00
parent 6fd11bb6f5
commit bb64f8ff3d
3 changed files with 57 additions and 0 deletions

View 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);
}