From 78d1e45695b990e39e998a857051009ac10e1fea Mon Sep 17 00:00:00 2001 From: Nils Bergmann Date: Tue, 19 Dec 2023 18:41:34 +0100 Subject: [PATCH] fix(type): small type fix --- reactive_home/src/composeables/useLightMapping.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/reactive_home/src/composeables/useLightMapping.ts b/reactive_home/src/composeables/useLightMapping.ts index f18bf9b..10170b9 100644 --- a/reactive_home/src/composeables/useLightMapping.ts +++ b/reactive_home/src/composeables/useLightMapping.ts @@ -210,9 +210,11 @@ export type UseLightMappingOptions = { export function parseAutoEnableTimeFactory( input?: MaybeRef ) { + const defaultValue = 15 * 60 * 1000; + return computed(() => { if (!input) { - return 15 * 60 * 1000; + return defaultValue; } let value = unref(input); if (typeof value === "number") { @@ -221,7 +223,7 @@ export function parseAutoEnableTimeFactory( if (typeof value === "object") { value = value.state; } - return parse(value, "ms"); + return parse(value, "ms") ?? defaultValue; }); }