@@ -55,6 +55,7 @@ use std::{
5555} ;
5656use tauri:: { AppHandle , Manager , Runtime , State , WindowEvent } ;
5757use tauri_nspanel:: ManagerExt ;
58+ use tauri_plugin_notification:: NotificationExt ;
5859use tauri_plugin_shell:: ShellExt ;
5960use tauri_specta:: Event ;
6061use tokio:: task;
@@ -360,6 +361,10 @@ async fn start_recording(app: AppHandle, state: MutableState<'_, App>) -> Result
360361 if let Some ( window) = ( CapWindow :: InProgressRecording { position : None } ) . get ( & app) {
361362 window. eval ( "window.location.reload()" ) . unwrap ( ) ;
362363 window. show ( ) . unwrap ( ) ;
364+ } else {
365+ CapWindow :: InProgressRecording { position : None }
366+ . show ( & app)
367+ . ok ( ) ;
363368 }
364369
365370 AppSounds :: StartRecording . play ( ) ;
@@ -1470,16 +1475,16 @@ async fn remove_fake_window(
14701475 Ok ( ( ) )
14711476}
14721477
1473- #[ tauri:: command( async ) ]
1474- #[ specta:: specta]
1475- fn show_notifications_window ( app : AppHandle ) {
1476- if app. get_webview_window ( "notifications" ) . is_some ( ) {
1477- println ! ( "notifications window already exists" ) ;
1478- return ;
1479- }
1478+ // #[tauri::command(async)]
1479+ // #[specta::specta]
1480+ // fn show_notifications_window(app: AppHandle) {
1481+ // if app.get_webview_window("notifications").is_some() {
1482+ // println!("notifications window already exists");
1483+ // return;
1484+ // }
14801485
1481- CapWindow :: Notifications . show ( & app) . unwrap ( ) ;
1482- }
1486+ // CapWindow::Notifications.show(&app).unwrap();
1487+ // }
14831488
14841489#[ tauri:: command( async ) ]
14851490#[ specta:: specta]
@@ -2345,7 +2350,7 @@ pub async fn run() {
23452350 list_capture_screens,
23462351 list_audio_devices,
23472352 show_previous_recordings_window,
2348- show_notifications_window,
2353+ // show_notifications_window,
23492354 close_previous_recordings_window,
23502355 set_fake_window_bounds,
23512356 remove_fake_window,
@@ -2437,6 +2442,7 @@ pub async fn run() {
24372442 . plugin ( tauri_plugin_oauth:: init ( ) )
24382443 . plugin ( tauri_plugin_http:: init ( ) )
24392444 . plugin ( tauri_plugin_updater:: Builder :: new ( ) . build ( ) )
2445+ . plugin ( tauri_plugin_notification:: init ( ) )
24402446 . plugin ( flags:: plugin:: init ( ) )
24412447 . invoke_handler ( specta_builder. invoke_handler ( ) )
24422448 . setup ( move |app| {
@@ -2552,12 +2558,6 @@ pub async fn run() {
25522558 } ) ;
25532559 } ) ;
25542560
2555- let app_handle_clone = app_handle. clone ( ) ;
2556- tauri:: async_runtime:: spawn ( async move {
2557- tokio:: time:: sleep ( Duration :: from_secs ( 5 ) ) . await ;
2558- AuthenticationInvalid . emit ( & app_handle_clone) . ok ( ) ;
2559- } ) ;
2560-
25612561 let app_handle_clone = app_handle. clone ( ) ;
25622562 AuthenticationInvalid :: listen_any ( app, move |_| {
25632563 let app_handle = app_handle_clone. clone ( ) ;
0 commit comments