fix is_disable_switch_model

This commit is contained in:
Qing
2022-11-25 08:55:10 +08:00
parent d44dd8822c
commit f7d7e89197
4 changed files with 42 additions and 18 deletions

View File

@@ -34,6 +34,7 @@ export interface Rect {
interface AppState {
disableShortCuts: boolean
isInpainting: boolean
isDisableModelSwitch: boolean
}
export const appState = atom<AppState>({
@@ -41,6 +42,7 @@ export const appState = atom<AppState>({
default: {
disableShortCuts: false,
isInpainting: false,
isDisableModelSwitch: false,
},
})
@@ -66,6 +68,18 @@ export const isInpaintingState = selector({
},
})
export const isDisableModelSwitchState = selector({
key: 'isDisableModelSwitchState',
get: ({ get }) => {
const app = get(appState)
return app.isDisableModelSwitch
},
set: ({ get, set }, newValue: any) => {
const app = get(appState)
set(appState, { ...app, isDisableModelSwitch: newValue })
},
})
export const croperState = atom<Rect>({
key: 'croperState',
default: {