prefMagnets now follows config saves.

This commit is contained in:
Kylart 2017-04-16 15:18:34 +02:00
parent ee3424e98e
commit 68f7899152
3 changed files with 22 additions and 8 deletions

View File

@ -1,5 +1,7 @@
<template xmlns:v-bind="http://www.w3.org/1999/xhtml">
<v-app id="app" class="grey lighten-1" top-toolbar left-sidebar>
<v-app id="app"
class="grey lighten-1"
top-toolbar left-sidebar>
<v-toolbar class="dragable">
<v-toolbar-side-icon class="non-dragable" @click.native.stop="sidebar = !sidebar"/>
<v-toolbar-logo class="text-xs-right title" v-bind:style="title">
@ -139,11 +141,14 @@
<h2 class="title">Which anime are you looking for?</h2>
</v-card-text>
<v-card-text class="subheading grey--text">
Blabla
<v-text-field name="search-input"
v-model="searchInput"
label="Anime name">
</v-text-field>
</v-card-text>
<v-card-row actions>
<v-spacer></v-spacer>
<v-btn flat v-on:click.native="searchModal = false" class="primary--text">Search!</v-btn>
<v-btn dark primary v-on:click.native="searchModal = false">Search!</v-btn>
</v-card-row>
</v-card>
</v-modal>
@ -308,6 +313,9 @@
},
configDir: function () {
return this.$store.state.configDir
},
searchInput: function () {
return this.$store.state.searchInput
}
},
methods: {
@ -326,6 +334,9 @@
saveAndClose() {
this.save()
this.configModal = false
},
test() {
console.log('Hello')
}
}
}

View File

@ -13,7 +13,7 @@
<div class="choose-magnets">
<v-card class="z-depth-0">
<v-card-text class="switch">
<v-switch label="Get Magnets" primary v-model="$store.state.prefMagnets" dark/>
<v-switch label="Get Magnets" primary v-model="$store.state.config.magnets" dark/>
</v-card-text>
</v-card>
</div>
@ -162,7 +162,7 @@
this.$store.commit('setQuality', quality)
console.log('Magnets is ' + this.$store.state.prefMagnets)
console.log('Magnets is ' + this.$store.state.config.magnets)
if (this.$store.state.downloaderForm.name)
this.$store.dispatch('download')

View File

@ -29,7 +29,6 @@ Vue.use(Vuex)
const store = new Vuex.Store({
state: {
releases: [],
prefMagnets: config.magnets,
downloaderForm: {
name: '',
fromEp: '',
@ -58,7 +57,11 @@ const store = new Vuex.Store({
},
configDir: config.localPath,
currentDir: config.localPath,
searchInputModal: false
searchInputModal: false,
searchInput: '',
searchInfo: {
}
},
mutations: {
setCurrentSeason(state, data) {
@ -230,7 +233,7 @@ const store = new Vuex.Store({
: 20000
const quality = state.downloaderForm.quality
const magnets = state.prefMagnets
const magnets = state.config.magnets
console.log(`Received a request to download ${name} from ep ${fromEp} to ep ${untilEp}. Transmitting...`)