Skip to content

Commit 5fb1e4a

Browse files
committed
1.0.3
1 parent 1091673 commit 5fb1e4a

1 file changed

Lines changed: 30 additions & 1 deletion

File tree

src/main.rs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,4 +352,33 @@ fn main_loop(
352352
Cmd::Exit => {
353353
// Restore everything cleanly before exiting
354354
let mut state = state_shared.lock().unwrap();
355-
355+
profiles::restore_all(&mut state);
356+
return Ok(());
357+
}
358+
359+
Cmd::UpdateAvailable(version) => {
360+
let cfg = config_shared.lock().unwrap().clone();
361+
notifications::notify_update_available(&version, &cfg.notifications);
362+
eprintln!("Update available: {version}");
363+
}
364+
365+
Cmd::HotkeyFailed(hotkey) => {
366+
let cfg = config_shared.lock().unwrap().clone();
367+
notifications::notify_hotkey_failed(&hotkey, &cfg.notifications);
368+
}
369+
}
370+
}
371+
}
372+
}
373+
374+
/// Update Discord Rich Presence if enabled.
375+
fn update_discord(state: &AppState, config: &AppConfig) {
376+
if config.discord.enabled {
377+
discord::set_rich_presence(
378+
state.icons_hidden,
379+
state.taskbar_hidden,
380+
state.windows_hidden,
381+
state.active_profile.clone(),
382+
);
383+
}
384+
}

0 commit comments

Comments
 (0)