Skip to content

manage single instance of desktop app - #35

Merged
joshaber merged 4 commits into
oauthfrom
single-instance
May 31, 2016
Merged

joshaber merged 4 commits into
oauthfrom
single-instance

Conversation

@shiftkey

Copy link
Copy Markdown
Member

This leverages app.makeSingleInstance so that Windows will pass the OAuth callback to the original instance (rather than launching a new one).

Also adds some wrappers to restore and focus the window.

I could optimize this so it's only configured for non-OSX platforms. Feels?

@shiftkey shiftkey mentioned this pull request May 31, 2016
@joshaber

Copy link
Copy Markdown
Contributor

I donut understand why neither Travis nor AppVeyor are running on this. 😭

@joshaber joshaber self-assigned this May 31, 2016
@joshaber

Copy link
Copy Markdown
Contributor

Maybe because it's targeting another PR? 😠

Comment thread src/main-process/main.ts Outdated
// Someone tried to run a second instance, we should focus our window.
if (mainWindow) {
if (mainWindow.isMinimized()) {
mainWindow.restore();

This comment was marked as spam.

@joshaber

Copy link
Copy Markdown
Contributor

I could optimize this so it's only configured for non-OSX platforms. Feels?

Yeah, even though I imagine it's a no-op on OS X, for the sake of communication it seems worthwhile to conditionalize.

@shiftkey

Copy link
Copy Markdown
Member Author

🍎

@joshaber

joshaber commented May 31, 2016 •

Copy link
Copy Markdown
Contributor

🤘 Thanks for taking care of that!

@joshaber
joshaber merged commit f868905 into oauth May 31, 2016
@joshaber
joshaber deleted the single-instance branch May 31, 2016 15:15
@joshaber joshaber removed their assignment Sep 29, 2016
robbertakse pushed a commit to robbertakse/desktop that referenced this pull request Mar 3, 2024
robbertakse pushed a commit to robbertakse/desktop that referenced this pull request Mar 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants