Skip to content

Commit 3e673c2

Browse files
committed
Bug fixes, dependency updates
1 parent 854dd96 commit 3e673c2

12 files changed

+761
-991
lines changed

app/view/preferences.js

+15-7
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ ipc.on('getOptions', (event, options) => {
6969
$('#history .history-container > ul').append(element)
7070
}
7171

72-
if (options.showIcon === true) $('#showIcon').prop('checked', true)
73-
if (options.deleteOnUpload === true) $('#deleteOnUpload').prop('checked', true)
74-
if (options.startAtLogin === true) $('#startAtLogin').prop('checked', true)
72+
if (options.showIcon === true) { $('#showIcon').prop('checked', true) }
73+
74+
if (options.deleteOnUpload === true) { $('#deleteOnUpload').prop('checked', true) }
75+
76+
if (options.startAtLogin === true) { $('#startAtLogin').prop('checked', true) }
7577

7678
if (options.shortcuts) {
7779
for (const shortcut of Object.keys(options.shortcuts)) {
@@ -91,11 +93,8 @@ ipc.on('getOptions', (event, options) => {
9193

9294
if (options.customService) {
9395
$('#servicePrompt input[name="uploadPath"]').val(options.customService.uploadPath)
94-
$('select[name="uploadService"]').val('custom')
95-
}
96-
97-
if (options.customService) {
9896
$('#servicePrompt input[name="resultPath"]').val(options.customService.resultPath)
97+
$('select[name="uploadService"]').val('custom')
9998
}
10099
})
101100

@@ -140,6 +139,7 @@ $('a[href="#cancel"]').click(() => {
140139

141140
$('input[type="checkbox"]').change(function () {
142141
let option = $(this).attr('id')
142+
143143
optionsObj[option] = this.checked
144144
})
145145

@@ -149,14 +149,20 @@ $('select[name="uploadService"]').change(function () {
149149
return (
150150
showPrompt('#servicePrompt')
151151
)
152+
} else {
153+
delete optionsObj.customService
152154
}
155+
153156
if (!optionsObj.services) optionsObj.services = {}
157+
154158
optionsObj.services.uploadService = service
155159
})
156160

157161
$('select[name="shortenerService"]').change(function () {
158162
let service = $(this).find('option:selected').val()
163+
159164
if (!optionsObj.services) optionsObj.services = {}
165+
160166
optionsObj.services.shortenerService = service
161167
})
162168

@@ -198,13 +204,15 @@ function parseTime (str) {
198204

199205
function saveAndClose () {
200206
ipc.send('saveOptions', optionsObj)
207+
201208
remote.getCurrentWindow().close()
202209
}
203210

204211
function parseCombo (combo) {
205212
if (combo.includes('meta')) {
206213
combo = combo.replace('meta', 'command')
207214
}
215+
208216
return combo
209217
}
210218

0 commit comments

Comments
 (0)