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
e4829f80af
commit
0792b9175e
@ -16,16 +16,16 @@ export const BASE_CONTEXT = {};
|
||||
export const $logger = atom<Logger>(Roarr.child(BASE_CONTEXT));
|
||||
|
||||
export const zLogNamespace = z.enum([
|
||||
'gallery',
|
||||
'models',
|
||||
'config',
|
||||
'canvas',
|
||||
'generation',
|
||||
'workflows',
|
||||
'system',
|
||||
'config',
|
||||
'events',
|
||||
'queue',
|
||||
'gallery',
|
||||
'generation',
|
||||
'metadata',
|
||||
'models',
|
||||
'system',
|
||||
'queue',
|
||||
'workflows',
|
||||
]);
|
||||
const zLogNamespacesArray = z.array(zLogNamespace);
|
||||
export type LogNamespace = z.infer<typeof zLogNamespace>;
|
||||
|
@ -15,11 +15,11 @@ export const SettingsDeveloperLogNamespaces = memo(() => {
|
||||
if (s.system.logNamespaces.length === 0) {
|
||||
return EMPTY_ARRAY;
|
||||
} else {
|
||||
return s.system.logNamespaces.toSorted();
|
||||
return s.system.logNamespaces;
|
||||
}
|
||||
});
|
||||
const disabledLogNamespaces = useMemo(
|
||||
() => difference(zLogNamespace.options, enabledLogNamespaces).toSorted(),
|
||||
() => difference(zLogNamespace.options, enabledLogNamespaces),
|
||||
[enabledLogNamespaces]
|
||||
);
|
||||
|
||||
|
@ -35,9 +35,9 @@ export const systemSlice = createSlice({
|
||||
},
|
||||
logNamespaceToggled: (state, action: PayloadAction<LogNamespace>) => {
|
||||
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 {
|
||||
state.logNamespaces = uniq([...state.logNamespaces, action.payload]);
|
||||
state.logNamespaces = uniq([...state.logNamespaces, action.payload]).toSorted();
|
||||
}
|
||||
},
|
||||
shouldAntialiasProgressImageChanged: (state, action: PayloadAction<boolean>) => {
|
||||
|
Loading…
Reference in New Issue
Block a user