[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 `Escape` shortcut improper hiding

Kasper (May 7, 2023, 3:10 AM +0200) be96ab6f 778ca684

+13 -10
+1
CHANGELOG.md
··· 5 5 - Request notifications permission on startup 6 6 - Show notification style setting recommendation 7 7 - Fix title/description update resetting when clicking the text fields 8 + - Fix `Escape` shortcut not hiding the window properly 8 9 9 10 ## 1.1.1 - 2022 Dec 10 10 11 - Update dependencies
+9 -8
src-tauri/src/main.rs
··· 81 81 let app = tauri::Builder::default() 82 82 .invoke_handler(tauri::generate_handler![ 83 83 error_popup, 84 + hide, 84 85 notifications::new_group, 85 86 notifications::get_groups, 86 87 notifications::update_group, ··· 169 170 .map(|w| w.is_visible().unwrap()) 170 171 .unwrap_or(false); 171 172 if is_visible { 172 - hide(&app.app_handle()); 173 + hide(app.app_handle()); 173 174 } else { 174 175 show(&app.app_handle()); 175 176 } ··· 191 192 tauri::RunEvent::WindowEvent { event, .. } => match event { 192 193 tauri::WindowEvent::CloseRequested { api, .. } => { 193 194 api.prevent_close(); 194 - hide(app_handle); 195 + hide(app_handle.app_handle()); 195 196 } 196 197 _ => {} 197 198 }, ··· 209 210 None => create_window(&app.app_handle()), 210 211 }; 211 212 #[cfg(target_os = "macos")] 212 - app.show().unwrap(); 213 - window.show().unwrap(); 214 - window.unminimize().unwrap(); 215 - window.set_focus().unwrap(); 216 - #[cfg(target_os = "macos")] 217 213 { 214 + app.show().unwrap(); 218 215 set_is_accessory_policy(false); 219 216 } 217 + window.show().unwrap(); 218 + window.unminimize().unwrap(); 219 + window.set_focus().unwrap(); 220 220 } 221 - fn hide(app: &AppHandle) { 221 + #[command] 222 + fn hide(app: AppHandle) { 222 223 let window = app.get_window("main").unwrap(); 223 224 window.unminimize().unwrap(); 224 225 window.hide().unwrap();
+3 -2
src/App.svelte
··· 8 8 import { checkShortcut, runCmd } from './lib/helpers' 9 9 import type { Group } from './lib/types' 10 10 import { onDestroy } from 'svelte' 11 - import { event, window as tauriWindow, os } from '@tauri-apps/api' 11 + import { event, os } from '@tauri-apps/api' 12 + import { invoke } from '@tauri-apps/api/tauri' 12 13 13 14 let groupElements: Item[] = [] 14 15 let focusedGroup: number | null = null ··· 57 58 <svelte:body 58 59 on:keydown={async (e) => { 59 60 if (checkShortcut(e, 'Escape')) { 60 - tauriWindow.appWindow.hide() 61 + invoke('hide') 61 62 e.preventDefault() 62 63 } 63 64 }}