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