Skip to content

Commit

Permalink
🐛 Fix: choose default picBed failure
Browse files Browse the repository at this point in the history
ISSUES CLOSED: #537
  • Loading branch information
Molunerfinn committed Jul 12, 2020
1 parent 4f0809e commit 21d3942
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/main/apis/app/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export function createContextMenu () {
checked: db.get('picBed.current') === item.type,
click () {
picgo.saveConfig({
'picBed.current': item.type
'picBed.current': item.type,
'picBed.uploader': item.type
})
if (windowManager.has(IWindowList.SETTING_WINDOW)) {
windowManager.get(IWindowList.SETTING_WINDOW)!.webContents.send('syncPicBed')
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/components/ChoosePicBed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export default {
methods: {
choosePicBed (val) {
this.letPicGoSaveData({
'picBed.current': this.type
'picBed.current': this.type,
'picBed.uploader': this.type
})
this.$emit('update:choosed', this.type)
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/pages/MiniPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ export default class extends Vue {
checked: this.$db.get('picBed.current') === item.type,
click () {
_this.letPicGoSaveData({
'picBed.current': item.type
'picBed.current': item.type,
'picBed.uploader': item.type
})
ipcRenderer.send('syncPicBed')
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/pages/Plugin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ export default class extends Vue {
const current = this.$db.get('picBed.current')
if (current === name) {
this.letPicGoSaveData({
'picBed.current': 'smms'
'picBed.current': 'smms',
'picBed.uploader': 'smms'
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/pages/Upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ export default class extends Vue {
checked: this.$db.get('picBed.current') === item.type,
click () {
_this.letPicGoSaveData({
'picBed.current': item.type
'picBed.current': item.type,
'picBed.uploader': item.type
})
ipcRenderer.send('syncPicBed')
}
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/pages/picbeds/Others.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ export default class extends Vue {
}
setDefaultPicBed (type: string) {
this.letPicGoSaveData({
'picBed.current': type
'picBed.current': type,
'picBed.uploader': type
})
// @ts-ignore 来自mixin的数据
this.defaultPicBed = type
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/utils/ConfirmButtonMixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export default class extends Vue {
defaultPicBed = this.$db.get('picBed.current')
setDefaultPicBed (type: string) {
this.letPicGoSaveData({
'picBed.current': type
'picBed.current': type,
'picBed.uploader': type
})
this.defaultPicBed = type
const successNotification = new Notification('设置默认图床', {
Expand Down
2 changes: 1 addition & 1 deletion src/universal/datastore/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DB {

if (!this.db.has('picBed').value()) {
this.db.set('picBed', {
current: 'smms',
current: 'smms', // deprecated
uploader: 'smms',
smms: {
token: ''
Expand Down

0 comments on commit 21d3942

Please sign in to comment.