chore(ui): clean up persist denylists

This commit is contained in:
psychedelicious 2023-05-16 09:46:03 +10:00
parent 9f4d39aa42
commit d68c14516c
11 changed files with 2 additions and 64 deletions

View File

@ -3,18 +3,8 @@ import { CanvasState } from './canvasTypes';
/**
* Canvas slice persist denylist
*/
const itemsToDenylist: (keyof CanvasState)[] = [
'cursorPosition',
'isCanvasInitialized',
'doesCanvasNeedScaling',
];
export const canvasPersistDenylist: (keyof CanvasState)[] = [
'cursorPosition',
'isCanvasInitialized',
'doesCanvasNeedScaling',
];
export const canvasDenylist = itemsToDenylist.map(
(denylistItem) => `canvas.${denylistItem}`
);

View File

@ -3,16 +3,7 @@ import { GalleryState } from './gallerySlice';
/**
* Gallery slice persist denylist
*/
const itemsToDenylist: (keyof GalleryState)[] = [
'currentCategory',
'shouldAutoSwitchToNewImages',
];
export const galleryPersistDenylist: (keyof GalleryState)[] = [
'currentCategory',
'shouldAutoSwitchToNewImages',
];
export const galleryDenylist = itemsToDenylist.map(
(denylistItem) => `gallery.${denylistItem}`
);

View File

@ -3,12 +3,6 @@ import { ResultsState } from './resultsSlice';
/**
* Results slice persist denylist
*
* Currently denylisting results slice entirely, see persist config in store.ts
* Currently denylisting results slice entirely, see `serialize.ts`
*/
const itemsToDenylist: (keyof ResultsState)[] = [];
export const resultsPersistDenylist: (keyof ResultsState)[] = [];
export const resultsDenylist = itemsToDenylist.map(
(denylistItem) => `results.${denylistItem}`
);

View File

@ -3,11 +3,6 @@ import { UploadsState } from './uploadsSlice';
/**
* Uploads slice persist denylist
*
* Currently denylisting uploads slice entirely, see persist config in store.ts
* Currently denylisting uploads slice entirely, see `serialize.ts`
*/
const itemsToDenylist: (keyof UploadsState)[] = [];
export const uploadsPersistDenylist: (keyof UploadsState)[] = [];
export const uploadsDenylist = itemsToDenylist.map(
(denylistItem) => `uploads.${denylistItem}`
);

View File

@ -3,11 +3,6 @@ import { LightboxState } from './lightboxSlice';
/**
* Lightbox slice persist denylist
*/
const itemsToDenylist: (keyof LightboxState)[] = ['isLightboxOpen'];
export const lightboxPersistDenylist: (keyof LightboxState)[] = [
'isLightboxOpen',
];
export const lightboxDenylist = itemsToDenylist.map(
(denylistItem) => `lightbox.${denylistItem}`
);

View File

@ -3,12 +3,7 @@ import { NodesState } from './nodesSlice';
/**
* Nodes slice persist denylist
*/
const itemsToDenylist: (keyof NodesState)[] = ['schema', 'invocationTemplates'];
export const nodesPersistDenylist: (keyof NodesState)[] = [
'schema',
'invocationTemplates',
];
export const nodesDenylist = itemsToDenylist.map(
(denylistItem) => `nodes.${denylistItem}`
);

View File

@ -3,9 +3,4 @@ import { GenerationState } from './generationSlice';
/**
* Generation slice persist denylist
*/
const itemsToDenylist: (keyof GenerationState)[] = [];
export const generationPersistDenylist: (keyof GenerationState)[] = [];
export const generationDenylist = itemsToDenylist.map(
(denylistItem) => `generation.${denylistItem}`
);

View File

@ -3,9 +3,4 @@ import { PostprocessingState } from './postprocessingSlice';
/**
* Postprocessing slice persist denylist
*/
const itemsToDenylist: (keyof PostprocessingState)[] = [];
export const postprocessingPersistDenylist: (keyof PostprocessingState)[] = [];
export const postprocessingDenylist = itemsToDenylist.map(
(denylistItem) => `postprocessing.${denylistItem}`
);

View File

@ -3,9 +3,4 @@ import { ModelsState } from './modelSlice';
/**
* Models slice persist denylist
*/
const itemsToDenylist: (keyof ModelsState)[] = ['entities', 'ids'];
export const modelsPersistDenylist: (keyof ModelsState)[] = ['entities', 'ids'];
export const modelsDenylist = itemsToDenylist.map(
(denylistItem) => `models.${denylistItem}`
);

View File

@ -5,14 +5,12 @@ import { SystemState } from './systemSlice';
*/
export const systemPersistDenylist: (keyof SystemState)[] = [
'currentIteration',
'currentStatus',
'currentStep',
'isCancelable',
'isConnected',
'isESRGANAvailable',
'isGFPGANAvailable',
'isProcessing',
'socketId',
'totalIterations',
'totalSteps',
'openModel',

View File

@ -3,11 +3,6 @@ import { UIState } from './uiTypes';
/**
* UI slice persist denylist
*/
const itemsToDenylist: (keyof UIState)[] = ['floatingProgressImageRect'];
export const uiPersistDenylist: (keyof UIState)[] = [
'floatingProgressImageRect',
];
export const uiDenylist = itemsToDenylist.map(
(denylistItem) => `ui.${denylistItem}`
);