mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-29 21:11:51 +03:00
fix: load default folder #417
This commit is contained in:
parent
68223f5f45
commit
c63d0a4039
5 changed files with 15 additions and 8 deletions
|
@ -282,8 +282,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.commit('FETCH_SETTINGS')
|
|
||||||
this.$store.commit('FETCH_CATEGORIES')
|
|
||||||
this.urls = this.initialMagnet
|
this.urls = this.initialMagnet
|
||||||
this.setSettings()
|
this.setSettings()
|
||||||
if (this.openSuddenly == true) {
|
if (this.openSuddenly == true) {
|
||||||
|
@ -294,11 +292,15 @@ export default {
|
||||||
this.dTransition = 'scale-transition'
|
this.dTransition = 'scale-transition'
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setSettings() {
|
async setSettings() {
|
||||||
|
await this.$store.dispatch('FETCH_SETTINGS')
|
||||||
|
await this.$store.commit('FETCH_CATEGORIES')
|
||||||
const settings = this.getSettings()
|
const settings = this.getSettings()
|
||||||
|
console.log(settings)
|
||||||
this.start = !settings.start_paused_enabled
|
this.start = !settings.start_paused_enabled
|
||||||
this.autoTMM = settings.auto_tmm_enabled
|
this.autoTMM = settings.auto_tmm_enabled
|
||||||
this.root_folder = settings.create_subfolder_enabled
|
this.root_folder = settings.create_subfolder_enabled
|
||||||
|
this.directory = settings.save_path
|
||||||
},
|
},
|
||||||
addDropFile(e) {
|
addDropFile(e) {
|
||||||
this.showWrapDrag = false
|
this.showWrapDrag = false
|
||||||
|
|
|
@ -114,7 +114,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.$store.commit('FETCH_SETTINGS')
|
this.$store.dispatch('FETCH_SETTINGS')
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
close() {
|
close() {
|
||||||
|
|
|
@ -13,7 +13,7 @@ export default {
|
||||||
qbit.setPreferences(this.getSettings()).then(() => {
|
qbit.setPreferences(this.getSettings()).then(() => {
|
||||||
Vue.$toast.success(this.$t('toast.settingsSaved'))
|
Vue.$toast.success(this.$t('toast.settingsSaved'))
|
||||||
})
|
})
|
||||||
await this.$store.commit('FETCH_SETTINGS')
|
await this.$store.dispatch('FETCH_SETTINGS')
|
||||||
await this.$store.commit('SET_LANGUAGE')
|
await this.$store.commit('SET_LANGUAGE')
|
||||||
this.close()
|
this.close()
|
||||||
if (!this.settings.alternative_webui_enabled) {
|
if (!this.settings.alternative_webui_enabled) {
|
||||||
|
|
|
@ -23,5 +23,11 @@ export default {
|
||||||
Vue.$toast.error(i18n.t('toast.loginFailed'))
|
Vue.$toast.error(i18n.t('toast.loginFailed'))
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
},
|
||||||
|
FETCH_SETTINGS: async context => {
|
||||||
|
const { data } = await qbit.getAppPreferences()
|
||||||
|
context.commit('FETCH_SETTINGS', data)
|
||||||
|
|
||||||
|
return data
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,9 +65,8 @@ export default {
|
||||||
Torrents.update(data)
|
Torrents.update(data)
|
||||||
DocumentTitle.update()
|
DocumentTitle.update()
|
||||||
},
|
},
|
||||||
FETCH_SETTINGS: async state => {
|
FETCH_SETTINGS: async (state, settings) => {
|
||||||
const { data } = await qbit.getAppPreferences()
|
state.settings = settings
|
||||||
state.settings = data
|
|
||||||
},
|
},
|
||||||
UPDATE_SORT_OPTIONS: (state, {
|
UPDATE_SORT_OPTIONS: (state, {
|
||||||
hashes = [],
|
hashes = [],
|
||||||
|
|
Loading…
Add table
Reference in a new issue