From 72a8d6c8cff8869019c3ce0cb1a38f806d964604 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 31 May 2025 13:38:01 +0200 Subject: convert all manual message stuff to FlashMessage --- ui/src/account/settings.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'ui/src/account/settings.rs') diff --git a/ui/src/account/settings.rs b/ui/src/account/settings.rs index 7c5a3b8..7334c62 100644 --- a/ui/src/account/settings.rs +++ b/ui/src/account/settings.rs @@ -4,9 +4,9 @@ Copyright (C) 2025 metamuffin */ use crate::{ - Page, + FlashM, Page, locale::{Language, tr, trs}, - scaffold::SessionInfo, + scaffold::{FlashDisplay, SessionInfo}, }; use jellycommon::{ routes::{u_account_login, u_account_settings}, @@ -24,14 +24,9 @@ impl Page for SettingsPage<'_> { } markup::define! { - SettingsPage<'a>(flash: Option>, session: &'a SessionInfo, lang: &'a Language) { + SettingsPage<'a>(session: &'a SessionInfo, lang: &'a Language, flash: &'a FlashM) { h1 { "Settings" } - @if let Some(flash) = &flash { - @match flash { - Ok(mesg) => { section.message { p.success { @mesg } } } - Err(err) => { section.message { p.error { @format!("{err}") } } } - } - } + @FlashDisplay {flash} h2 { @trs(&lang, "account") } a.switch_account[href=u_account_login()] { "Switch Account" } form[method="POST", action=u_account_settings()] { -- cgit v1.2.3-70-g09d2