Added unstash buttons to non-favorites stash items
This commit is contained in:
@@ -60,19 +60,26 @@
|
||||
></span>
|
||||
|
||||
<Icon
|
||||
v-show="favorited"
|
||||
v-show="(!stash || stash.primary) && favorited"
|
||||
icon="heart7"
|
||||
class="stash stashed"
|
||||
@click.prevent.native="unstashActor"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="favorited === false"
|
||||
v-show="(!stash || stash.primary) && favorited === false"
|
||||
icon="heart8"
|
||||
class="stash unstashed"
|
||||
@click.prevent.native="stashActor"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="stash && !stash.primary"
|
||||
icon="cross2"
|
||||
class="stash unstash"
|
||||
@click.prevent.native="unstashActor"
|
||||
/>
|
||||
|
||||
<span
|
||||
class="details"
|
||||
>
|
||||
@@ -145,12 +152,14 @@ async function stashActor() {
|
||||
}
|
||||
|
||||
async function unstashActor() {
|
||||
this.favorited = false;
|
||||
if (!this.stash || this.stash.primary) {
|
||||
this.favorited = false;
|
||||
}
|
||||
|
||||
try {
|
||||
await this.$store.dispatch('unstashActor', {
|
||||
actorId: this.actor.id,
|
||||
stashId: this.$store.getters.favorites.id,
|
||||
stashId: this.stash?.id || this.$store.getters.favorites.id,
|
||||
});
|
||||
|
||||
this.$emit('stash', false);
|
||||
@@ -176,6 +185,10 @@ export default {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
stash: {
|
||||
type: Object,
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
emits: ['stash'],
|
||||
data() {
|
||||
@@ -209,6 +222,11 @@ export default {
|
||||
display: inline-block;
|
||||
padding-bottom: 150%;
|
||||
}
|
||||
|
||||
&:hover .unstashed,
|
||||
&:hover .unstash {
|
||||
fill: var(--lighten);
|
||||
}
|
||||
}
|
||||
|
||||
.link {
|
||||
@@ -307,10 +325,15 @@ export default {
|
||||
fill: var(--lighten-weak);
|
||||
filter: drop-shadow(0 0 2px var(--darken));
|
||||
|
||||
&:hover,
|
||||
&:hover.unstashed,
|
||||
&.stashed {
|
||||
fill: var(--primary);
|
||||
}
|
||||
|
||||
&:hover.unstash {
|
||||
fill: var(--text-light);
|
||||
filter: drop-shadow(0 0 2px var(--darken-weak));
|
||||
}
|
||||
}
|
||||
|
||||
.details {
|
||||
|
||||
Reference in New Issue
Block a user