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

Commit

Permalink
Improve code of setTimeout as one line
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Nov 1, 2016
1 parent 22e9ea5 commit b6e9b3f
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions coffee/classes/mds_window.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,10 @@ module.exports = class MdsWindow
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
# Wrap by setTimeout to avoid app termination unexpectedly on Linux.
setTimeout =>
@trigger 'save', 'forceClose'
, 0
when 1
setTimeout =>
@trigger 'forceClose'
, 0
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 b6e9b3f

Please # to comment.