Fixed favorite status on scene tile.

This commit is contained in:
DebaucheryLibrarian 2021-03-21 04:08:46 +01:00
parent 11e043ca2e
commit 35c28dede2
1 changed files with 8 additions and 8 deletions

View File

@ -42,14 +42,14 @@
><Icon icon="blocked" />No thumbnail available</div> ><Icon icon="blocked" />No thumbnail available</div>
<Icon <Icon
v-show="stashed" v-show="favorited"
icon="heart7" icon="heart7"
class="stash stashed" class="stash stashed"
@click.prevent.native="unstashScene" @click.prevent.native="unstashScene"
/> />
<Icon <Icon
v-show="stashed === false" v-show="favorited === false"
icon="heart8" icon="heart8"
class="stash unstashed" class="stash unstashed"
@click.prevent.native="stashScene" @click.prevent.native="stashScene"
@ -148,7 +148,7 @@
import Details from './tile-details.vue'; import Details from './tile-details.vue';
async function stashScene() { async function stashScene() {
this.stashed = true; this.favorited = true;
try { try {
await this.$store.dispatch('stashScene', { await this.$store.dispatch('stashScene', {
@ -158,22 +158,22 @@ async function stashScene() {
this.$emit('stash', true); this.$emit('stash', true);
} catch (error) { } catch (error) {
this.stashed = false; this.favorited = false;
} }
} }
async function unstashScene() { async function unstashScene() {
this.stashed = false; this.favorited = false;
try { try {
this.$store.dispatch('unstashScene', { await this.$store.dispatch('unstashScene', {
sceneId: this.release.id, sceneId: this.release.id,
stashId: this.$store.getters.favorites.id, stashId: this.$store.getters.favorites.id,
}); });
this.$emit('stash', false); this.$emit('stash', false);
} catch (error) { } catch (error) {
this.stashed = true; this.favorited = true;
} }
} }
@ -190,7 +190,7 @@ export default {
emits: ['stash'], emits: ['stash'],
data() { data() {
return { return {
stashed: this.release.isStashed, favorited: this.release.isFavorited,
}; };
}, },
methods: { methods: {