diff --git a/control/frontend/src/lib/components/DisplayGroupObject.svelte b/control/frontend/src/lib/components/DisplayGroupObject.svelte index 56d10b5..ec2a554 100644 --- a/control/frontend/src/lib/components/DisplayGroupObject.svelte +++ b/control/frontend/src/lib/components/DisplayGroupObject.svelte @@ -12,7 +12,7 @@ import { all_displays_of_group_selected, get_display_ids_in_group, - select_all_of_group, + set_select_for_group, set_new_display_order } from '$lib/ts/stores/displays'; import DNDGrip from '$lib/components/DNDGrip.svelte'; @@ -41,7 +41,7 @@ async function select_all_of_this_group() { const new_value = !($all_selected || false); - await select_all_of_group(display_group_id, new_value); + await set_select_for_group(display_group_id, new_value); } async function handle_consider(e: CustomEvent) { diff --git a/control/frontend/src/lib/ts/stores/displays.ts b/control/frontend/src/lib/ts/stores/displays.ts index 5144c13..e7248e2 100755 --- a/control/frontend/src/lib/ts/stores/displays.ts +++ b/control/frontend/src/lib/ts/stores/displays.ts @@ -82,10 +82,7 @@ export async function all_displays_of_group_selected( return true; } -export async function select_all_of_group( - display_group_id: string, - new_value: boolean | null = null -) { +export async function set_select_for_group(display_group_id: string, new_value: boolean) { const displays_of_group: Display[] = await db.displays .where('group_id') .equals(display_group_id) diff --git a/control/frontend/src/routes/DisplayView.svelte b/control/frontend/src/routes/DisplayView.svelte index 24599c9..45703b1 100755 --- a/control/frontend/src/routes/DisplayView.svelte +++ b/control/frontend/src/routes/DisplayView.svelte @@ -4,14 +4,13 @@ all_displays_of_group_selected, get_display_by_id, get_display_groups, - select_all_of_group, + set_select_for_group, set_new_display_group_order } from '$lib/ts/stores/displays'; import { change_height, current_height, dnd_flip_duration_ms, - get_selectable_color_classes, is_display_drag, is_group_drag, next_height_step_size, @@ -80,10 +79,10 @@ ]; } - async function select_all(current_displays: DisplayGroup[]) { - const new_value = !all_groups_selected; + async function toggle_all_selected_displays(current_displays: DisplayGroup[]) { + const new_value = !$all_groups_selected; for (const display_group of current_displays) { - await select_all_of_group(display_group.id, new_value); + await set_select_for_group(display_group.id, new_value); } } @@ -204,16 +203,8 @@