Fix fetching notification settings from db (#8761)

Co-authored-by: LoveSy <shana@zju.edu.cn>
This commit is contained in:
Wang Han 2025-02-04 17:42:21 +08:00 committed by GitHub
parent c913f7ec74
commit a14fc90f07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,12 +23,11 @@ impl SqlTable for RootSettings {
fn on_row(&mut self, columns: &[String], values: &DbValues) {
for (i, column) in columns.iter().enumerate() {
let val = values.get_int(i as i32);
if column == "policy" {
self.policy.repr = val;
} else if column == "logging" {
self.log = val != 0;
} else if column == "notify" {
self.notify = val != 0;
match column.as_str() {
"policy" => self.policy.repr = val,
"logging" => self.log = val != 0,
"notification" => self.notify = val != 0,
_ => {}
}
}
}