mirror of https://github.com/keeweb/keeweb
release date
parent
083cbe9840
commit
893a0f43c1
|
@ -38,7 +38,7 @@ const Alerts = {
|
|||
Alerts.alertDisplayed = true;
|
||||
const view = new ModalView(config);
|
||||
view.render();
|
||||
view.on('result', (res, check) => {
|
||||
view.once('result', (res, check) => {
|
||||
if (res && config.success) {
|
||||
config.success(res, check);
|
||||
}
|
||||
|
|
|
@ -333,6 +333,8 @@
|
|||
"appSaveError": "Save Error",
|
||||
"appSaveErrorBody": "Failed to auto-save file",
|
||||
"appSaveErrorBodyMul": "Failed to auto-save files:",
|
||||
"appSaveErrorExitLoseChanges": "Quit and lose all changes",
|
||||
"appSaveErrorExitLoseChangesBody": "You can either quit the app and lose all changes, or go file settings to export data",
|
||||
"appSettingsError": "Error loading app",
|
||||
"appSettingsErrorBody": "There was an error loading app settings. Please double check the app URL or contact your administrator.",
|
||||
"appNotSupportedError": "Your browser doesn't support some important features we're using.",
|
||||
|
|
|
@ -382,11 +382,14 @@ class AppView extends View {
|
|||
if (Launcher) {
|
||||
if (!this.exitAlertShown) {
|
||||
if (this.model.settings.autoSave) {
|
||||
this.saveAndLock((result) => {
|
||||
if (result) {
|
||||
exit();
|
||||
}
|
||||
});
|
||||
this.saveAndLock(
|
||||
(result) => {
|
||||
if (result) {
|
||||
exit();
|
||||
}
|
||||
},
|
||||
{ appClosing: true }
|
||||
);
|
||||
return Launcher.preventExit(e);
|
||||
}
|
||||
this.exitAlertShown = true;
|
||||
|
@ -400,11 +403,14 @@ class AppView extends View {
|
|||
],
|
||||
success: (result) => {
|
||||
if (result === 'save') {
|
||||
this.saveAndLock((result) => {
|
||||
if (result) {
|
||||
exit();
|
||||
}
|
||||
});
|
||||
this.saveAndLock(
|
||||
(result) => {
|
||||
if (result) {
|
||||
exit();
|
||||
}
|
||||
},
|
||||
{ appClosing: true }
|
||||
);
|
||||
} else {
|
||||
exit();
|
||||
}
|
||||
|
@ -531,7 +537,7 @@ class AppView extends View {
|
|||
}
|
||||
}
|
||||
|
||||
saveAndLock(complete) {
|
||||
saveAndLock(complete, options) {
|
||||
let pendingCallbacks = 0;
|
||||
const errorFiles = [];
|
||||
this.model.files.forEach(function (file) {
|
||||
|
@ -551,17 +557,37 @@ class AppView extends View {
|
|||
if (--pendingCallbacks === 0) {
|
||||
if (errorFiles.length && this.model.files.hasDirtyFiles()) {
|
||||
if (!Alerts.alertDisplayed) {
|
||||
const alertBody =
|
||||
const buttons = [Alerts.buttons.ok];
|
||||
const errorStr =
|
||||
errorFiles.length > 1
|
||||
? Locale.appSaveErrorBodyMul
|
||||
: Locale.appSaveErrorBody;
|
||||
let body = errorStr + ' ' + errorFiles.join(', ') + '.';
|
||||
if (options?.appClosing) {
|
||||
buttons.unshift({
|
||||
result: 'ignore',
|
||||
title: Locale.appSaveErrorExitLoseChanges,
|
||||
error: true
|
||||
});
|
||||
body += '\n' + Locale.appSaveErrorExitLoseChangesBody;
|
||||
}
|
||||
Alerts.error({
|
||||
header: Locale.appSaveError,
|
||||
body: alertBody + ' ' + errorFiles.join(', ')
|
||||
body,
|
||||
buttons,
|
||||
complete: (res) => {
|
||||
if (res === 'ignore') {
|
||||
this.model.closeAllFiles();
|
||||
complete(true);
|
||||
} else {
|
||||
complete(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
if (complete) {
|
||||
complete(false);
|
||||
} else {
|
||||
if (complete) {
|
||||
complete(false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.closeAllFilesAndShowFirst();
|
||||
|
|
|
@ -55,8 +55,8 @@ class ModalView extends View {
|
|||
this.closeWithResult(result);
|
||||
}
|
||||
|
||||
bodyClick() {
|
||||
if (typeof this.model.click === 'string') {
|
||||
bodyClick(e) {
|
||||
if (typeof this.model.click === 'string' && !e.target.matches('button')) {
|
||||
this.closeWithResult(this.model.click);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ $fa-var-info-circle: next-fa-glyph();
|
|||
$fa-var-key: next-fa-glyph();
|
||||
$fa-var-globe: next-fa-glyph();
|
||||
$fa-var-exclamation-triangle: next-fa-glyph();
|
||||
$fa-var-exclamation-circle: next-fa-glyph();
|
||||
$fa-var-thumbtack: next-fa-glyph();
|
||||
$fa-var-comments: next-fa-glyph();
|
||||
$fa-var-edit: next-fa-glyph();
|
||||
|
|
|
@ -2,9 +2,10 @@ Release notes
|
|||
-------------
|
||||
##### v1.16.1 (2020-12-04)
|
||||
`+` Argon2id KDF support
|
||||
`+` added an options to quit the app and lose all changes
|
||||
`-` fix #1637: git commit in the About box
|
||||
`-` fixed some design glitches
|
||||
`*` keyfile paths are saved by default
|
||||
`*` keyfile paths are saved by default
|
||||
|
||||
##### v1.16.0 (2020-11-29)
|
||||
`+` updated icons and visual design
|
||||
|
|
Loading…
Reference in New Issue