mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-06 00:04:39 +00:00
refactor: change types from Map to Record in playerStore
This commit is contained in:
parent
2fb6fe47e0
commit
57245d99b7
1 changed files with 4 additions and 4 deletions
|
@ -3,8 +3,8 @@ import { create } from "zustand";
|
||||||
import { persist } from "zustand/middleware";
|
import { persist } from "zustand/middleware";
|
||||||
|
|
||||||
interface userPlayerPreferencesState {
|
interface userPlayerPreferencesState {
|
||||||
voiceover: Map<number, string>;
|
voiceover: Record<number, string>;
|
||||||
player: Map<number, string>;
|
player: Record<number, string>;
|
||||||
getPreferredVoiceover: (id: number) => (string | undefined);
|
getPreferredVoiceover: (id: number) => (string | undefined);
|
||||||
setPreferredVoiceover: (id: number, voiceover: string) => void;
|
setPreferredVoiceover: (id: number, voiceover: string) => void;
|
||||||
getPreferredPlayer: (id: number) => (string | undefined);
|
getPreferredPlayer: (id: number) => (string | undefined);
|
||||||
|
@ -14,8 +14,8 @@ interface userPlayerPreferencesState {
|
||||||
export const useUserPlayerPreferencesStore = create<userPlayerPreferencesState>()(
|
export const useUserPlayerPreferencesStore = create<userPlayerPreferencesState>()(
|
||||||
persist(
|
persist(
|
||||||
(set, get) => ({
|
(set, get) => ({
|
||||||
voiceover: new Map<number, string>(),
|
voiceover: {},
|
||||||
player: new Map<number, string>(),
|
player: {},
|
||||||
getPreferredVoiceover: (id: number) => get().voiceover[id],
|
getPreferredVoiceover: (id: number) => get().voiceover[id],
|
||||||
setPreferredVoiceover: (id: number, voiceover: string) => {
|
setPreferredVoiceover: (id: number, voiceover: string) => {
|
||||||
let current = get().voiceover
|
let current = get().voiceover
|
||||||
|
|
Loading…
Add table
Reference in a new issue