Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Commit

Permalink
Merge pull request #112 from yhatt/fix-cancel-confirmation
Browse files Browse the repository at this point in the history
Fix #104: Avoid app termination unexpectedly on Linux
  • Loading branch information
yhatt authored Nov 6, 2016
2 parents b461f09 + b6e9b3f commit 2369b73
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions coffee/classes/mds_window.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,12 @@ module.exports = class MdsWindow
title: 'Marp'
message: 'Are you sure?'
detail: "#{@getShortPath()} has been modified. Do you want to save the changes?"
cancelId: 2
, (result) =>
# Wrap by setTimeout to avoid app termination unexpectedly on Linux.
switch result
when 0 then @trigger 'save', 'forceClose'
when 1 then @trigger 'forceClose'
when 0 then setTimeout (=> @trigger 'save', 'forceClose'), 0
when 1 then setTimeout (=> @trigger 'forceClose'), 0
else
MdsWindow.appWillQuit = false

Expand Down

0 comments on commit 2369b73

Please # to comment.