Skip to content

Commit

Permalink
Display newest conversation at launch (#1135)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitecrownclown authored and sindresorhus committed Oct 30, 2019
1 parent 1e6eb29 commit 89911d5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,12 @@ function createMainWindow(): BrowserWindow {
app.dock.show();
}

ipcMain.once('conversations', () => {
// Messenger sorts the conversations by unread state.
// We select the first conversation from the list.
sendAction('jump-to-conversation', 1);
});

ipcMain.on('conversations', (_event: ElectronEvent, conversations: Conversation[]) => {
if (conversations.length === 0) {
return;
Expand Down

0 comments on commit 89911d5

Please sign in to comment.