Skip to content

Commit

Permalink
Added: upload notification swtich
Browse files Browse the repository at this point in the history
  • Loading branch information
Molunerfinn committed Jun 5, 2018
1 parent 947e49a commit 3455512
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/main/utils/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const checkUploader = (type) => {
}

const uploader = (img, type, webContents) => {
const notification = new Notification({
title: '上传进度',
body: '正在上传'
})
notification.show()
if (db.read().get('picBed.uploadNotification').value()) {
const notification = new Notification({
title: '上传进度',
body: '正在上传'
})
notification.show()
}
const uploadType = db.read().get('picBed.current').value()
if (checkUploader(uploadType)) {
return picBeds[uploadType](img, type, webContents)
Expand Down
16 changes: 15 additions & 1 deletion src/renderer/components/SettingView/PicGoSetting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@
@change="handleAutoRename"
></el-switch>
</el-form-item>
<el-form-item
label="开启上传提示"
>
<el-switch
v-model="form.uploadNotification"
active-text=""
inactive-text=""
@change="handleUploadNotification"
></el-switch>
</el-form-item>
<el-form-item
label="选择显示的图床"
>
Expand Down Expand Up @@ -190,7 +200,8 @@ export default {
showPicBedList: [],
autoStart: this.$db.get('picBed.autoStart').value() || false,
rename: this.$db.get('picBed.rename').value() || false,
autoRename: this.$db.get('picBed.autoRename').value() || false
autoRename: this.$db.get('picBed.autoRename').value() || false,
uploadNotification: this.$db.get('picBed.uploadNotification').value() || false
},
picBed: this.$picBed,
keyBindingVisible: false,
Expand Down Expand Up @@ -302,6 +313,9 @@ export default {
},
cancelCheckVersion () {
this.checkUpdateVisible = false
},
handleUploadNotification (val) {
this.$db.read().set('picBed.uploadNotification', val).write()
}
},
beforeDestroy () {
Expand Down

0 comments on commit 3455512

Please sign in to comment.