frontend bugfix: Handle null input in ExpandableInput, make ntfy_url nullable (#1055)

* handle `null` input in `ExpandableInput`

* correct `ntfy_url` config type

* remove extra space
This commit is contained in:
recanman
2026-05-22 20:10:04 +00:00
committed by GitHub
parent e83ba9922d
commit e86d30a0c6
2 changed files with 8 additions and 4 deletions

View File

@@ -11,7 +11,7 @@
inputHelp = '',
children,
}: {
value: string;
value: string | null;
checkboxId: string;
inputId: string;
label: string;
@@ -21,7 +21,11 @@
children?: Snippet;
} = $props();
let expanded = $state(value.trim() !== '');
function has_value(text: string | null) {
return text !== null && text.trim() !== '';
}
let expanded = $state(has_value(value));
let inputElement = $state<HTMLInputElement | null>(null);
function handle_checkbox_change(e: Event) {
@@ -34,7 +38,7 @@
}
function handle_input_blur() {
if (value.trim() === '') {
if (!has_value(value)) {
expanded = false;
}
}

View File

@@ -50,7 +50,7 @@ export interface Config {
ui_level: number;
colorblind_mode: boolean;
key_input_mode: number;
ntfy_url: string;
ntfy_url: string | null;
enabled_notifications: enabled_notifications[];
analyzers: AnalyzerConfig;
min_space_to_start_recording_mb: number;