mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-11 07:55:52 +01:00
🐛 Fix deprecated zustand dependencies
This commit is contained in:
@@ -360,54 +360,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "135b7adf-0616-481f-991e-a9035d66b924",
|
|
||||||
"type": "torrents-status",
|
|
||||||
"properties": {
|
|
||||||
"displayCompletedTorrents": true,
|
|
||||||
"displayStaleTorrents": true,
|
|
||||||
"labelFilterIsWhitelist": true,
|
|
||||||
"labelFilter": []
|
|
||||||
},
|
|
||||||
"area": {
|
|
||||||
"type": "wrapper",
|
|
||||||
"properties": {
|
|
||||||
"id": "default"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"shape": {
|
|
||||||
"sm": {
|
|
||||||
"location": {
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"width": 2,
|
|
||||||
"height": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"md": {
|
|
||||||
"location": {
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"width": 2,
|
|
||||||
"height": 2
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lg": {
|
|
||||||
"location": {
|
|
||||||
"x": 0,
|
|
||||||
"y": 0
|
|
||||||
},
|
|
||||||
"size": {
|
|
||||||
"width": 2,
|
|
||||||
"height": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { create } from 'zustand';
|
import { createWithEqualityFn } from 'zustand/traditional';
|
||||||
|
|
||||||
interface EditModeState {
|
interface EditModeState {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
toggleEditMode: () => void;
|
toggleEditMode: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useEditModeStore = create<EditModeState>((set) => ({
|
export const useEditModeStore = createWithEqualityFn<EditModeState>(
|
||||||
|
(set) => ({
|
||||||
enabled: false,
|
enabled: false,
|
||||||
toggleEditMode: () => set((state) => ({ enabled: !state.enabled })),
|
toggleEditMode: () => set((state) => ({ enabled: !state.enabled })),
|
||||||
}));
|
}),
|
||||||
|
Object.is
|
||||||
|
);
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
import { create } from 'zustand';
|
import { createWithEqualityFn } from 'zustand/traditional';
|
||||||
|
|
||||||
import { useConfigContext } from '../../../../config/provider';
|
import { useConfigContext } from '../../../../config/provider';
|
||||||
import { GridstackBreakpoints } from '../../../../constants/gridstack-breakpoints';
|
import { GridstackBreakpoints } from '../../../../constants/gridstack-breakpoints';
|
||||||
|
|
||||||
export const useGridstackStore = create<GridstackStoreType>((set, get) => ({
|
export const useGridstackStore = createWithEqualityFn<GridstackStoreType>(
|
||||||
|
(set, get) => ({
|
||||||
mainAreaWidth: null,
|
mainAreaWidth: null,
|
||||||
currentShapeSize: null,
|
currentShapeSize: null,
|
||||||
setMainAreaWidth: (w: number) =>
|
setMainAreaWidth: (w: number) =>
|
||||||
set((v) => ({ ...v, mainAreaWidth: w, currentShapeSize: getCurrentShapeSize(w) })),
|
set((v) => ({ ...v, mainAreaWidth: w, currentShapeSize: getCurrentShapeSize(w) })),
|
||||||
}));
|
}),
|
||||||
|
Object.is
|
||||||
|
);
|
||||||
|
|
||||||
interface GridstackStoreType {
|
interface GridstackStoreType {
|
||||||
mainAreaWidth: null | number;
|
mainAreaWidth: null | number;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import { create } from 'zustand';
|
import { createWithEqualityFn } from 'zustand/traditional';
|
||||||
import { trcpProxyClient } from '~/utils/api';
|
import { trcpProxyClient } from '~/utils/api';
|
||||||
|
|
||||||
import { ConfigType } from '../types/config';
|
import { ConfigType } from '../types/config';
|
||||||
|
|
||||||
export const useConfigStore = create<UseConfigStoreType>((set, get) => ({
|
export const useConfigStore = createWithEqualityFn<UseConfigStoreType>(
|
||||||
|
(set, get) => ({
|
||||||
configs: [],
|
configs: [],
|
||||||
initConfig: (name, config, increaseVersion) => {
|
initConfig: (name, config, increaseVersion) => {
|
||||||
set((old) => ({
|
set((old) => ({
|
||||||
@@ -68,7 +69,9 @@ export const useConfigStore = create<UseConfigStoreType>((set, get) => ({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}));
|
}),
|
||||||
|
Object.is
|
||||||
|
);
|
||||||
|
|
||||||
interface UseConfigStoreType {
|
interface UseConfigStoreType {
|
||||||
configs: { increaseVersion: () => void; value: ConfigType }[];
|
configs: { increaseVersion: () => void; value: ConfigType }[];
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { create } from 'zustand';
|
import { createWithEqualityFn } from 'zustand/traditional';
|
||||||
|
|
||||||
import { ServerSidePackageAttributesType } from '../../server/getPackageVersion';
|
import { ServerSidePackageAttributesType } from '../../server/getPackageVersion';
|
||||||
|
|
||||||
@@ -7,9 +7,12 @@ interface PackageAttributesState {
|
|||||||
setInitialPackageAttributes: (attributes: ServerSidePackageAttributesType) => void;
|
setInitialPackageAttributes: (attributes: ServerSidePackageAttributesType) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const usePackageAttributesStore = create<PackageAttributesState>((set) => ({
|
export const usePackageAttributesStore = createWithEqualityFn<PackageAttributesState>(
|
||||||
|
(set) => ({
|
||||||
attributes: { packageVersion: undefined, environment: 'test', dependencies: {} },
|
attributes: { packageVersion: undefined, environment: 'test', dependencies: {} },
|
||||||
setInitialPackageAttributes(attributes) {
|
setInitialPackageAttributes(attributes) {
|
||||||
set((state) => ({ ...state, attributes }));
|
set((state) => ({ ...state, attributes }));
|
||||||
},
|
},
|
||||||
}));
|
}),
|
||||||
|
Object.is
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user