[READ-ONLY] Mirror of https://github.com/probablykasper/remind-me-again. Toggleable cron reminders app for Mac, Linux and Windows
linux macos notifications reminder tauri windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix crashing issue ๐ŸŽ‰

Kasper (Jul 11, 2022, 10:58 PM +0200) 952c6e73 bca112fe

+14 -9
+3 -2
src-tauri/Cargo.lock
··· 1476 1476 1477 1477 [[package]] 1478 1478 name = "mac-notification-sys" 1479 - version = "0.5.3" 1479 + version = "0.5.2" 1480 1480 source = "registry+https://github.com/rust-lang/crates.io-index" 1481 - checksum = "47a4acb83c904844ca12aafeac6fff6f781cf9e220a985c1db94fd94123993aa" 1481 + checksum = "042f74a606175d72ca483e14e0873fe0f6c003f7af45865b17b16fdaface7203" 1482 1482 dependencies = [ 1483 1483 "cc", 1484 1484 "dirs-next", ··· 2275 2275 "chrono", 2276 2276 "cocoa", 2277 2277 "cron", 2278 + "mac-notification-sys", 2278 2279 "macos-app-nap", 2279 2280 "nanoid", 2280 2281 "objc",
+2
src-tauri/Cargo.toml
··· 26 26 tao = "0.12" 27 27 once_cell = "1.13" 28 28 cron = "0.11" 29 + # https://github.com/h4llow3En/mac-notification-sys/issues/43 30 + mac-notification-sys = "=0.5.2" 29 31 30 32 [target.'cfg(target_os = "macos")'.dependencies] 31 33 macos-app-nap = "0.0.1"
+9 -5
src-tauri/src/main.rs
··· 12 12 use std::thread; 13 13 use tauri::api::{dialog, shell}; 14 14 use tauri::{ 15 - command, AboutMetadata, AppHandle, CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, Submenu, 16 - Window, WindowBuilder, WindowUrl, 15 + command, AboutMetadata, AppHandle, CustomMenuItem, Manager, Menu, MenuEntry, MenuItem, State, 16 + Submenu, Window, WindowBuilder, WindowUrl, 17 17 }; 18 18 use tauri::{SystemTray, SystemTrayEvent}; 19 19 ··· 49 49 enabled: true, 50 50 id: "0".to_string(), 51 51 job_id: None, 52 - cron: "0 * * * * *".to_string(), 52 + cron: "*/10 * * * * *".to_string(), 53 53 next_date: None, 54 54 }]; 55 - let mut instance = Instance { 55 + let instance = Instance { 56 56 groups, 57 57 bg_handle: None, 58 58 bundle_identifier: ctx.config().tauri.bundle.identifier.clone(), 59 59 }; 60 - instance.start(); 61 60 62 61 let app = tauri::Builder::default() 63 62 .invoke_handler(tauri::generate_handler![ ··· 153 152 }) 154 153 .build(ctx) 155 154 .expect("error while running tauri application"); 155 + { 156 + let data: State<Data> = app.state(); 157 + let mut x = data.0.lock().unwrap(); 158 + x.start(); 159 + } 156 160 157 161 app.run(|app_handle, e| match e { 158 162 tauri::RunEvent::ExitRequested { api, .. } => {
-2
src-tauri/src/notifications.rs
··· 3 3 use nanoid::nanoid; 4 4 use serde::{Deserialize, Serialize}; 5 5 use serde_json::Value; 6 - use std::panic::catch_unwind; 7 6 use std::str::FromStr; 8 7 use std::sync::Mutex; 9 8 use tauri::api::dialog; ··· 39 38 let job = Job::cron_schedule(c); 40 39 let group = self.clone(); 41 40 let job_id = scheduler.insert(job, move |_id| { 42 - println!("Remind {}", group.title); 43 41 let result = Notification::new(&a) 44 42 .title(&group.title) 45 43 .body(&group.description)