mirror of
https://github.com/usebruno/bruno.git
synced 2025-06-20 19:58:10 +02:00
Recent documents menu (#1582)
* Adds recent documents menu. * Removes erroneous import. * Open collection from recent document menu.
This commit is contained in:
parent
d05a86252b
commit
8287126deb
@ -12,6 +12,16 @@ const template = [
|
||||
ipcMain.emit('main:open-collection');
|
||||
}
|
||||
},
|
||||
{
|
||||
label: 'Open Recent',
|
||||
role: 'recentdocuments',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Clear Recent',
|
||||
role: 'clearrecentdocuments'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Preferences',
|
||||
accelerator: 'CommandOrControl+,',
|
||||
|
@ -122,3 +122,7 @@ app.on('ready', async () => {
|
||||
|
||||
// Quit the app once all windows are closed
|
||||
app.on('window-all-closed', app.quit);
|
||||
|
||||
app.on('open-file', (event, path) => {
|
||||
openCollection(mainWindow, watcher, path);
|
||||
})
|
@ -617,6 +617,7 @@ const registerMainEventHandlers = (mainWindow, watcher, lastOpenedCollections) =
|
||||
ipcMain.on('main:collection-opened', (win, pathname, uid, brunoConfig) => {
|
||||
watcher.addWatcher(win, pathname, uid, brunoConfig);
|
||||
lastOpenedCollections.add(pathname);
|
||||
app.addRecentDocument(pathname);
|
||||
});
|
||||
|
||||
// The app listen for this event and allows the user to save unsaved requests before closing the app
|
||||
|
Loading…
x
Reference in New Issue
Block a user