diff options
author | metamuffin <metamuffin@disroot.org> | 2025-05-31 13:38:01 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-05-31 13:38:01 +0200 |
commit | 72a8d6c8cff8869019c3ce0cb1a38f806d964604 (patch) | |
tree | eae26a41700a9001eee715b4a4cf0c08deb1e0dd /ui/src/account | |
parent | 373243a81f8c44fcfc6a3612ba46da2c6a3286c6 (diff) | |
download | jellything-72a8d6c8cff8869019c3ce0cb1a38f806d964604.tar jellything-72a8d6c8cff8869019c3ce0cb1a38f806d964604.tar.bz2 jellything-72a8d6c8cff8869019c3ce0cb1a38f806d964604.tar.zst |
convert all manual message stuff to FlashMessage
Diffstat (limited to 'ui/src/account')
-rw-r--r-- | ui/src/account/settings.rs | 13 |
1 files changed, 4 insertions, 9 deletions
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 <metamuffin.org> */ 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<Result<String, String>>, 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()] { |