CRUCIAL bug fixed in the admin panel non admin user

This commit is contained in:
filipriec
2025-04-16 13:43:44 +02:00
parent cc994fb940
commit 6d3c09d57a

View File

@@ -72,7 +72,13 @@ pub async fn run_ui() -> Result<(), Box<dyn std::error::Error>> {
AppView::Intro => app_state.ui.show_intro = true, AppView::Intro => app_state.ui.show_intro = true,
AppView::Login => app_state.ui.show_login = true, AppView::Login => app_state.ui.show_login = true,
AppView::Register => app_state.ui.show_register = true, AppView::Register => app_state.ui.show_register = true,
AppView::Admin => app_state.ui.show_admin = true, AppView::Admin => {
app_state.ui.show_admin = true;
let profile_names = app_state.profile_tree.profiles.iter()
.map(|p| p.name.clone())
.collect();
admin_state.set_profiles(profile_names);
}
AppView::Form(_) => app_state.ui.show_form = true, AppView::Form(_) => app_state.ui.show_form = true,
AppView::Scratch => {} // Or show a scratchpad component AppView::Scratch => {} // Or show a scratchpad component
} }