Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 22 additions & 6 deletions src/document/DocumentCommandHandlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1731,10 +1731,18 @@ define(function (require, exports, module) {
.finally(()=>{
raceAgainstTime(_safeNodeTerminate())
.finally(()=>{
// In Electron, use allowClose() to bypass the close handler
// (which would otherwise trigger another cleanup cycle).
// In Electron multi-window case, use allowClose() to bypass
// the close handler (which would otherwise trigger another
// cleanup cycle). But for last window, closeWindow() calls
// quitApp() (no loop) and runs quitTimeAppUpdateHandler.
if(window.__ELECTRON__) {
window.electronAPI.allowClose();
Phoenix.app.getPhoenixInstanceCount().then(count => {
if(count === 1) {
Phoenix.app.closeWindow();
} else {
window.electronAPI.allowClose();
}
});
} else {
Phoenix.app.closeWindow();
}
Expand Down Expand Up @@ -2276,11 +2284,19 @@ define(function (require, exports, module) {
raceAgainstTime(_safeNodeTerminate())
.finally(()=>{
closeInProgress = false;
// In Electron, we must call allowClose() to complete the original
// close request (sets forceClose=true). Calling closeWindow() would
// In Electron multi-window case, we must call allowClose() to
// complete the original close request. Calling closeWindow() would
// trigger a new close sequence and cause an infinite loop.
// But for last window, closeWindow() calls quitApp() (no loop),
// and we need it to run quitTimeAppUpdateHandler.
if(window.__ELECTRON__) {
window.electronAPI.allowClose();
Phoenix.app.getPhoenixInstanceCount().then(count => {
if(count === 1) {
Phoenix.app.closeWindow();
} else {
window.electronAPI.allowClose();
}
});
} else {
Phoenix.app.closeWindow();
}
Expand Down
11 changes: 9 additions & 2 deletions src/extensionsIntegrated/appUpdater/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// shell.js file. This is app updates are pretty core level even though we do it as an extension here.

define(function (require, exports, module) {
require("./update-electron");
const AppInit = require("utils/AppInit"),
Metrics = require("utils/Metrics"),
FileSystem = require("filesystem/FileSystem"),
Expand Down Expand Up @@ -517,11 +518,17 @@ define(function (require, exports, module) {

let updateInstalledDialogShown = false, updateFailedDialogShown = false;
AppInit.appReady(function () {
if(!window.__TAURI__ || Phoenix.isTestWindow) {
if(Phoenix.isTestWindow) {
return;
}
if(window.__ELECTRON__) {
// Electron updates handled by update-electron.js
return;
}
if(!window.__TAURI__) {
// app updates are only for desktop builds
return;
}
// todo electron edge for app updater
if (brackets.platform === "mac") {
// in mac, the `update.app.tar.gz` is downloaded, and only extracted on app quit.
// we do this only in mac as the `.app` file is extracted only at app quit and deleted
Expand Down
Loading
Loading