Skip to content

Commit

Permalink
Display the empty files and duplicated files warnings only if configu…
Browse files Browse the repository at this point in the history
…red to
  • Loading branch information
breard-r committed Nov 20, 2024
1 parent 4c5d56a commit 7c2a91d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/notification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ use dioxus_i18n::t;
#[component]
pub fn NotificationList() -> Element {
let fl = use_context::<Signal<FileList>>()();
let cfg = use_context::<Signal<Config>>()();

rsx! {
if fl.has_empty_files() {
if cfg.is_empty_file_warning_enabled() && fl.has_empty_files() {
Notification {
id: "empty_files_{fl.get_id()}",
level: NotificationLevel::Warning,
Expand All @@ -28,7 +30,7 @@ pub fn NotificationList() -> Element {
}
}

if fl.has_duplicated_files() {
if cfg.is_duplicate_file_warning_enabled() && fl.has_duplicated_files() {
Notification {
id: "duplicated_files_{fl.get_id()}",
level: NotificationLevel::Warning,
Expand Down

0 comments on commit 7c2a91d

Please sign in to comment.