From 543aa7d53136037f07302a5653bba90751ac1552 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sat, 16 Aug 2025 20:24:28 +0200 Subject: more refactors --- src/ui/ui_main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/ui/ui_main.cpp') diff --git a/src/ui/ui_main.cpp b/src/ui/ui_main.cpp index d8fd5d4..19ab6b4 100644 --- a/src/ui/ui_main.cpp +++ b/src/ui/ui_main.cpp @@ -37,8 +37,19 @@ void (*setupcalls[dashboard_view_state::END])(void) = { ui_setup_settings, }; +void (*destroycalls[dashboard_view_state::END])(void) = { + ui_destroy_invoices, + 0, + 0, + 0, + 0, + ui_destroy_settings, + 0, +}; + static void set_dashboard_state(dashboard_view_state state) { + if (dashboard_state != dashboard_view_state::END && destroycalls[dashboard_state]) destroycalls[dashboard_state](); dashboard_state = state; if (setupcalls[dashboard_state]) setupcalls[dashboard_state](); } -- cgit v1.2.3-70-g09d2