Fixed an issue where extensions are getting added multiple times when the user uses the "Save As" option.

refs #4855
This commit is contained in:
Aditya Toshniwal 2020-10-12 18:01:53 +05:30 committed by Akshay Joshi
parent 2b7e3ce64e
commit 67242862c4

View File

@ -151,7 +151,9 @@ module.exports = Alertify.dialog('createModeDlg', function() {
there is a . already but it's not following the last /, AND the there is a . already but it's not following the last /, AND the
extension isn't *, then we add the extension. extension isn't *, then we add the extension.
*/ */
if (ext != '*') { if ((!newFile.includes('.') ||
newFile.split('.').pop() != ext) &&
ext != '*') {
newFile = newFile + '.' + ext; newFile = newFile + '.' + ext;
$('.storage_dialog #uploader .input-path').val(newFile); $('.storage_dialog #uploader .input-path').val(newFile);
} }