Skip to content

Commit

Permalink
🐛 Fix: log-level filter bug
Browse files Browse the repository at this point in the history
if logLevel is not an array, it will throw an error to setting page

ISSUES CLOSED: #237
  • Loading branch information
Molunerfinn committed Apr 17, 2019
1 parent 748a7fd commit 4e02244
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/renderer/pages/PicGoSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@
v-model="form.logLevel"
multiple
collapse-tags
@change="handleLogLevelChange"
>
<el-option
v-for="(value, key) of logLevel"
Expand Down Expand Up @@ -285,6 +284,14 @@ export default {
return callback()
}
}
let logLevel = this.$db.read().get('settings.logLevel').value()
if (!Array.isArray(logLevel)) {
if (logLevel.length > 0) {
logLevel = [logLevel]
} else {
logLevel = ['all']
}
}
return {
form: {
updateHelper: this.$db.read().get('settings.showUpdateTip').value(),
Expand All @@ -294,7 +301,7 @@ export default {
autoRename: this.$db.read().get('settings.autoRename').value() || false,
uploadNotification: this.$db.read().get('settings.uploadNotification').value() || false,
miniWindowOntop: this.$db.read().get('settings.miniWindowOntop').value() || false,
logLevel: this.$db.read().get('settings.logLevel').value() || ['all']
logLevel
},
picBed: [],
logFileVisible: false,
Expand Down

0 comments on commit 4e02244

Please sign in to comment.