Skip to content

Commit

Permalink
Merge pull request #48 from aL0NEW0LF/main
Browse files Browse the repository at this point in the history
  • Loading branch information
Stormix authored Aug 28, 2023
2 parents 7bfeacb + 389b538 commit 5b6b10f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src-tauri/src/athan/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,21 @@ pub fn check_athan_time(store: &mut Store<Wry>, resources_path: PathBuf) {
let time_remaining = minutes_left.abs_diff(remind_bar_before);
debug!("Time left before remind: {}", time_remaining);

// Every minute, check if the current time is the time to remind of prayer

if hours_left == 0 && time_remaining == 0 {
debug!("{} minutes before {}",remind_bar_before, next_prayer.name().unwrap());

Notification::new("net.thembassy.athan")
.title("Athan Time")
.body(format!("{} minutes before {}",remind_bar_before, next_prayer.name().unwrap()))
.show()
.expect("Failed to show notification.");
}

// Every minute, check if the current time is one of the prayer times

if hours_left == 0 && time_remaining <= 1 {
if hours_left == 0 && minutes_left <= 1 {
debug!("Time for {}", next_prayer.name().unwrap());

Notification::new("net.thembassy.athan")
Expand Down

0 comments on commit 5b6b10f

Please sign in to comment.