fix(editor): Add optional chaining to pruning.isEnabled (no-changelog) (#12023)

This commit is contained in:
Alex Grozav 2024-12-09 15:46:20 +02:00 committed by GitHub
parent 78c64adb09
commit 127d864bbb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View file

@ -163,7 +163,7 @@ export interface FrontendSettings {
pruneTime: number;
licensePruneTime: number;
};
pruning: {
pruning?: {
isEnabled: boolean;
maxAge: number;
maxCount: number;

View file

@ -96,12 +96,12 @@ export function useDebugInfo() {
};
const pruningInfo = () => {
if (!settingsStore.pruning.isEnabled) return { enabled: false } as const;
if (!settingsStore.pruning?.isEnabled) return { enabled: false } as const;
return {
enabled: true,
maxAge: `${settingsStore.pruning.maxAge} hours`,
maxCount: `${settingsStore.pruning.maxCount} executions`,
maxAge: `${settingsStore.pruning?.maxAge} hours`,
maxCount: `${settingsStore.pruning?.maxCount} executions`,
} as const;
};

View file

@ -20,7 +20,8 @@
"@/*": ["./src/*"],
"n8n-design-system": ["../design-system/src/main.ts"],
"n8n-design-system/*": ["../design-system/src/*"],
"@n8n/chat/*": ["../@n8n/chat/src/*"]
"@n8n/chat/*": ["../@n8n/chat/src/*"],
"@n8n/api-types*": ["../@n8n/api-types/src*"]
},
"lib": ["esnext", "dom", "dom.iterable", "scripthost"],
// TODO: remove all options below this line