add: option to clear all notifications when you open the page
This commit is contained in:
parent
45ea91a768
commit
e7c4cf14aa
5 changed files with 19 additions and 3 deletions
|
@ -331,6 +331,14 @@ pub async fn notifications_request(
|
|||
Err(e) => return Err(Html(render_error(e, &jar, &data, &Some(user)).await)),
|
||||
};
|
||||
|
||||
// check and clear
|
||||
if profile.settings.auto_clear_notifs {
|
||||
if let Err(e) = data.0.delete_all_notifications(&user).await {
|
||||
return Err(Html(render_error(e, &jar, &data, &Some(user)).await));
|
||||
}
|
||||
}
|
||||
|
||||
// ...
|
||||
let lang = get_lang!(jar, data.0);
|
||||
let mut context = initial_context(&data.0.0.0, lang, &Some(user)).await;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue