Skip to content

Commit 4497eb2

Browse files
committed
fix(image-editor): prevent double discard changes confirmation
Signed-off-by: Hamza Mahjoubi <hamzamahjoubi221@gmail.com>
1 parent 9e78d25 commit 4497eb2

File tree

7 files changed

+34
-62
lines changed

7 files changed

+34
-62
lines changed

css/init-DeHWcMTY.chunk.css renamed to css/init-Bup_A7pJ.chunk.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

css/viewer-init.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* extracted by css-entry-points-plugin */
2-
@import './init-DeHWcMTY.chunk.css';
2+
@import './init-Bup_A7pJ.chunk.css';
33
@import './logger-60RCWKf0.chunk.css';
44
@import './NcActionButton-C9055XKu.chunk.css';
55
@import './NcActionLink-lgtGSyky.chunk.css';

js/logger-CnYEx3cj.chunk.mjs.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This file is generated from multiple sources. Included packages:
122122
- version: 5.0.0-dev.0
123123
- license: AGPL-3.0-or-later
124124
- vite
125-
- version: 5.4.15
125+
- version: 5.4.19
126126
- license: MIT
127127
- vite-plugin-node-polyfills
128128
- version: 0.23.0

js/logger-CnYEx3cj.chunk.mjs.map.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ This file is generated from multiple sources. Included packages:
122122
- version: 5.0.0-dev.0
123123
- license: AGPL-3.0-or-later
124124
- vite
125-
- version: 5.4.15
125+
- version: 5.4.19
126126
- license: MIT
127127
- vite-plugin-node-polyfills
128128
- version: 0.23.0

js/viewer-init.mjs

Lines changed: 28 additions & 30 deletions
Large diffs are not rendered by default.

js/viewer-init.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/ImageEditor.vue

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ export default {
145145
},
146146
147147
methods: {
148-
onClose(closingReason, haveNotSavedChanges) {
149-
if (haveNotSavedChanges) {
150-
this.onExitWithoutSaving()
151-
return
152-
}
148+
onClose() {
153149
window.removeEventListener('keydown', this.handleKeydown, true)
154150
this.$emit('close')
155151
},
@@ -206,28 +202,6 @@ export default {
206202
}
207203
},
208204
209-
/**
210-
* Show warning if unsaved changes
211-
*/
212-
onExitWithoutSaving() {
213-
OC.dialogs.confirmDestructive(
214-
translations.changesLoseWarningHint + '\n\n' + translations.discardChangesWarningHint,
215-
t('viewer', 'Unsaved changes'),
216-
{
217-
type: OC.dialogs.YES_NO_BUTTONS,
218-
confirm: t('viewer', 'Drop changes'),
219-
confirmClasses: 'error',
220-
cancel: translations.cancel,
221-
},
222-
(decision) => {
223-
if (!decision) {
224-
return
225-
}
226-
this.onClose('warning-ignored', false)
227-
},
228-
)
229-
},
230-
231205
// Key Handlers, override default Viewer arrow and escape key
232206
handleKeydown(event) {
233207
// Enter needs to be reached through as otherwise saving text does not work

0 commit comments

Comments
 (0)