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

Commit

Permalink
Merge pull request #10022 from adobe/kai/fix-9975-modal-dialog-is-not…
Browse files Browse the repository at this point in the history
…-modal

Fix #9975.
  • Loading branch information
redmunds committed Dec 2, 2014
2 parents 71b00c3 + 9afe56c commit e0c0b98
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions src/brackets.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,24 @@ define(function (require, exports, module) {
PerfUtils.addMeasurement("Application Startup");

if (PreferencesManager._isUserScopeCorrupt()) {
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_PREFS_CORRUPT_TITLE,
Strings.ERROR_PREFS_CORRUPT
)
var userPrefFullPath = PreferencesManager.getUserPrefFile();
// user scope can get corrupt only if the file exists, is readable,
// but malformed. no need to check for its existance.
var info = MainViewManager.findInAllWorkingSets(userPrefFullPath);
var paneId;
if (info.length) {
paneId = info[0].paneId;
}
FileViewController.openFileAndAddToWorkingSet(userPrefFullPath, paneId)
.done(function () {
CommandManager.execute(Commands.FILE_OPEN_PREFERENCES);
Dialogs.showModalDialog(
DefaultDialogs.DIALOG_ID_ERROR,
Strings.ERROR_PREFS_CORRUPT_TITLE,
Strings.ERROR_PREFS_CORRUPT
).done(function () {
// give the focus back to the editor with the pref file
MainViewManager.focusActivePane();
});
});
}

Expand Down

0 comments on commit e0c0b98

Please sign in to comment.