Skip to content

Commit 37b1403

Browse files
committed
Go to home page on window hide
1 parent 42405bd commit 37b1403

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src-tauri/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn handle_system_tray_event(app: &AppHandle, event: SystemTrayEvent) {
2323

2424
if window.is_visible().unwrap() {
2525
window.hide().unwrap();
26+
window.emit("window:hidden", false).unwrap();
2627
} else {
2728
window.show().unwrap();
2829
window.set_focus().unwrap();
@@ -75,6 +76,7 @@ fn handle_window_event(event: GlobalWindowEvent) {
7576
}
7677

7778
event.window().hide().unwrap();
79+
event.window().emit("window:hidden", true).unwrap();
7880
}
7981
}
8082

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const reasonFormatMap = {
4848
[NotificationReason.Invitation]: 'Invitation',
4949
[NotificationReason.Manual]: 'Manual',
5050
[NotificationReason.Mention]: 'Mention',
51-
[NotificationReason.ReviewRequested]: 'ReviewRequested',
51+
[NotificationReason.ReviewRequested]: 'Review Requested',
5252
[NotificationReason.SecurityAlert]: 'Security Alert',
5353
[NotificationReason.StateChange]: 'State Change',
5454
[NotificationReason.Subscribed]: 'Subscribed',

src/pages/SettingsPage.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AppStorage } from '../storage'
1212
import { InvokeCommand, Page } from '../constants'
1313
import { Icons } from '../components/Icons'
1414
import { useKey } from '../composables/useKey'
15+
import { useTauriEvent } from '../composables/useTauriEvent'
1516
1617
const store = useStore()
1718
@@ -39,6 +40,10 @@ watchDebounced(openAtStartup, (enabled) => {
3940
disableAutostart()
4041
}, { debounce: 350 })
4142
43+
useTauriEvent('window:hidden', () => {
44+
store.setPage(Page.Home)
45+
})
46+
4247
function handleBack() {
4348
if (accessToken.value == null)
4449
return store.setPage(Page.Landing)

0 commit comments

Comments
 (0)