helper Open message
This commit is contained in:
+30
@@ -32,6 +32,36 @@ async function buildMenu() {
|
|||||||
id: 'open',
|
id: 'open',
|
||||||
text: 'Open',
|
text: 'Open',
|
||||||
action: async () => {
|
action: async () => {
|
||||||
|
if (usePersistedStore.getState().acknowledgements.includes('openShortcut')) {
|
||||||
|
await invoke('show_toolbar')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const result = await message(
|
||||||
|
`You can also open the Toolbar using the default shortcut ${platform() === 'macos' ? 'Command + Shift + /' : 'Control + Shift + /'}.`,
|
||||||
|
{
|
||||||
|
title: 'Did you know?',
|
||||||
|
kind: 'info',
|
||||||
|
buttons: {
|
||||||
|
ok: 'Good to know',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
if (result !== 'Good to know' && result !== 'Ok') {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
usePersistedStore.setState((prev) => {
|
||||||
|
if (prev.acknowledgements.includes('openShortcut')) {
|
||||||
|
return prev
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
acknowledgements: [...prev.acknowledgements, 'openShortcut'],
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
await invoke('show_toolbar')
|
await invoke('show_toolbar')
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user