fix(files_external): check for changes when saving settings

Signed-off-by: Enjeck C <patrathewhiz@gmail.com>
pull/56375/head
Enjeck C 2025-10-28 08:56:14 +07:00 committed by Enjeck
parent c30e153aac
commit f96eb98700
1 changed files with 8 additions and 3 deletions

@ -554,6 +554,8 @@ MountOptionsDropdown.prototype = {
this.setOptions(mountOptions, visibleOptions, storage)
this.$el.appendTo($container)
this._initialOptions = JSON.stringify(this.getOptions())
MountOptionsDropdown._last = this
this.$el.trigger('show')
@ -1455,11 +1457,14 @@ MountConfigListView.prototype = _.extend({
})
dropDown.$el.on('hide', function() {
const mountOptions = dropDown.getOptions()
const newOptions = dropDown.getOptions()
const newOptionsStr = JSON.stringify(newOptions)
$('body').off('mouseup.mountOptionsDropdown')
$tr.find('input.mountOptions').val(JSON.stringify(mountOptions))
$tr.find('td.mountOptionsToggle>.icon-more').attr('aria-expanded', 'false')
self.saveStorageConfig($tr)
if (dropDown._initialOptions !== newOptionsStr) {
$tr.find('input.mountOptions').val(newOptionsStr)
self.saveStorageConfig($tr)
}
})
},
}, OC.Backbone.Events)