mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): sort log namespaces
This commit is contained in:
parent
f659995e1c
commit
6affc28da4
@ -16,16 +16,16 @@ export const BASE_CONTEXT = {};
|
|||||||
export const $logger = atom<Logger>(Roarr.child(BASE_CONTEXT));
|
export const $logger = atom<Logger>(Roarr.child(BASE_CONTEXT));
|
||||||
|
|
||||||
export const zLogNamespace = z.enum([
|
export const zLogNamespace = z.enum([
|
||||||
'gallery',
|
|
||||||
'models',
|
|
||||||
'config',
|
|
||||||
'canvas',
|
'canvas',
|
||||||
'generation',
|
'config',
|
||||||
'workflows',
|
|
||||||
'system',
|
|
||||||
'events',
|
'events',
|
||||||
'queue',
|
'gallery',
|
||||||
|
'generation',
|
||||||
'metadata',
|
'metadata',
|
||||||
|
'models',
|
||||||
|
'system',
|
||||||
|
'queue',
|
||||||
|
'workflows',
|
||||||
]);
|
]);
|
||||||
const zLogNamespacesArray = z.array(zLogNamespace);
|
const zLogNamespacesArray = z.array(zLogNamespace);
|
||||||
export type LogNamespace = z.infer<typeof zLogNamespace>;
|
export type LogNamespace = z.infer<typeof zLogNamespace>;
|
||||||
|
@ -15,11 +15,11 @@ export const SettingsDeveloperLogNamespaces = memo(() => {
|
|||||||
if (s.system.logNamespaces.length === 0) {
|
if (s.system.logNamespaces.length === 0) {
|
||||||
return EMPTY_ARRAY;
|
return EMPTY_ARRAY;
|
||||||
} else {
|
} else {
|
||||||
return s.system.logNamespaces.toSorted();
|
return s.system.logNamespaces;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const disabledLogNamespaces = useMemo(
|
const disabledLogNamespaces = useMemo(
|
||||||
() => difference(zLogNamespace.options, enabledLogNamespaces).toSorted(),
|
() => difference(zLogNamespace.options, enabledLogNamespaces),
|
||||||
[enabledLogNamespaces]
|
[enabledLogNamespaces]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -35,9 +35,9 @@ export const systemSlice = createSlice({
|
|||||||
},
|
},
|
||||||
logNamespaceToggled: (state, action: PayloadAction<LogNamespace>) => {
|
logNamespaceToggled: (state, action: PayloadAction<LogNamespace>) => {
|
||||||
if (state.logNamespaces.includes(action.payload)) {
|
if (state.logNamespaces.includes(action.payload)) {
|
||||||
state.logNamespaces = uniq(state.logNamespaces.filter((n) => n !== action.payload));
|
state.logNamespaces = uniq(state.logNamespaces.filter((n) => n !== action.payload)).toSorted();
|
||||||
} else {
|
} else {
|
||||||
state.logNamespaces = uniq([...state.logNamespaces, action.payload]);
|
state.logNamespaces = uniq([...state.logNamespaces, action.payload]).toSorted();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
shouldAntialiasProgressImageChanged: (state, action: PayloadAction<boolean>) => {
|
shouldAntialiasProgressImageChanged: (state, action: PayloadAction<boolean>) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user