Skip to content

Commit fa172d6

Browse files
authored
Fix swal callback not working (#6195 regressions) (#7324)
This fixes a number of callback regressions introduced by #6195.
1 parent 9cc7c5a commit fa172d6

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

modules/data_release/jsx/addPermissionForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class AddPermissionForm extends Component {
173173
text: 'Permission Update Success!',
174174
title: '',
175175
type: 'success',
176-
}, function() {
176+
}).then(function() {
177177
window.location.assign('/data_release');
178178
});
179179
this.props.fetchData();

modules/data_release/jsx/uploadFileForm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class UploadFileForm extends Component {
203203
showCancelButton: true,
204204
confirmButtonText: 'Yes, I am sure!',
205205
cancelButtonText: 'No, cancel it!',
206-
}, (isConfirm) => {
206+
}).then((isConfirm) => {
207207
if (isConfirm) {
208208
this.uploadFile(true);
209209
}
@@ -224,7 +224,7 @@ class UploadFileForm extends Component {
224224
text: 'Upload Successful!',
225225
title: '',
226226
type: 'success',
227-
}, function() {
227+
}).then(function() {
228228
window.location.assign('/data_release');
229229
});
230230
this.props.fetchData();

modules/help_editor/js/help_editor_helper.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ $("#save-help").click(function(e) {
7373
cancelButtonText: "Close",
7474
closeOnConfirm: false,
7575
closeOnCancel: true,
76-
},
77-
function(){
76+
}).then(function(){
7877
location.href = document.referrer;
7978
});
8079
},

modules/instrument_manager/jsx/uploadForm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class InstrumentUploadForm extends Component {
5151
swal.fire({
5252
title: 'Installation Successful!',
5353
type: 'success',
54-
}, function() {
54+
}).then(function() {
5555
window.location.assign(loris.BaseURL + '/instrument_manager/');
5656
});
5757
}
@@ -63,7 +63,7 @@ class InstrumentUploadForm extends Component {
6363
title: 'Upload Successful!',
6464
type: 'success',
6565
text: data.message,
66-
}, function() {
66+
}).then(function() {
6767
window.location.assign(loris.BaseURL + '/instrument_manager/');
6868
});
6969
}

modules/media/jsx/uploadForm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ class MediaUploadForm extends Component {
261261
showCancelButton: true,
262262
confirmButtonText: 'Yes, I am sure!',
263263
cancelButtonText: 'No, cancel it!',
264-
}, function(isConfirm) {
264+
}).then(function(isConfirm) {
265265
if (isConfirm) {
266266
this.uploadFile();
267267
} else {

0 commit comments

Comments
 (0)