Added unstash buttons to non-favorites stash items

This commit is contained in:
DebaucheryLibrarian
2021-09-12 23:21:39 +02:00
parent d3633f31ac
commit 65c79567d2
5 changed files with 92 additions and 20 deletions

View File

@@ -15,18 +15,25 @@
>
<Icon
v-show="favorited"
v-show="(!stash || stash.primary) && favorited"
icon="heart7"
class="stash stashed"
@click.prevent.native="unstashMovie"
/>
<Icon
v-show="favorited === false"
v-show="(!stash || stash.primary) && favorited === false"
icon="heart8"
class="stash unstashed"
@click.prevent.native="stashMovie"
/>
<Icon
v-show="stash && !stash.primary"
icon="cross2"
class="stash unstash"
@click.prevent.native="unstashMovie"
/>
</RouterLink>
<div class="info">
@@ -88,12 +95,14 @@ async function stashMovie() {
}
async function unstashMovie() {
this.favorited = false;
if (!this.stash || this.stash.primary) {
this.favorited = false;
}
try {
await this.$store.dispatch('unstashMovie', {
movieId: this.movie.id,
stashId: this.$store.getters.favorites.id,
stashId: this.stash?.id || this.$store.getters.favorites.id,
});
this.$emit('stash', false);
@@ -115,6 +124,10 @@ export default {
type: Object,
default: null,
},
stash: {
type: Object,
default: null,
},
},
data() {
return {
@@ -141,7 +154,8 @@ export default {
box-shadow: 0 0 3px var(--darken-weak);
font-size: 0;
&:hover .unstashed {
&:hover .unstashed,
&:hover .unstash {
fill: var(--lighten);
}
}
@@ -251,6 +265,11 @@ export default {
&.stashed {
fill: var(--primary);
}
&:hover.unstash {
fill: var(--text-light);
filter: drop-shadow(0 0 2px var(--darken-weak));
}
}
@media(max-width: $breakpoint-kilo) {