diff --git a/assets/components/actors/actor.vue b/assets/components/actors/actor.vue
index c60a1b4b..1a12d406 100644
--- a/assets/components/actors/actor.vue
+++ b/assets/components/actors/actor.vue
@@ -34,18 +34,11 @@
class="header-social"
/>
-
-
- stashActor(stash)"
+ @unstash="(stash) => unstashActor(stash)"
/>
@@ -390,6 +383,7 @@ import Expand from '../expand/expand.vue';
import Scroll from '../scroll/scroll.vue';
import Gender from './gender.vue';
import Social from './social.vue';
+import StashButton from '../stashes/button.vue';
async function fetchActor(scroll = true) {
const { actor, releases, totalCount } = await this.$store.dispatch('fetchActorById', {
@@ -402,37 +396,25 @@ async function fetchActor(scroll = true) {
this.actor = actor;
this.releases = releases;
this.totalCount = totalCount;
- this.stashed = this.actor.isStashed;
+ this.stashedBy = actor.stashes;
if (this.$refs.filter && scroll) {
this.$refs.filter.$el.scrollIntoView();
}
}
-async function stashActor() {
- this.stashed = true;
-
- try {
- this.$store.dispatch('stashActor', {
- actorId: this.actor.id,
- stashId: this.$store.getters.favorites.id,
- });
- } catch (error) {
- this.stashed = false;
- }
+async function stashActor(stashId) {
+ this.stashedBy = await this.$store.dispatch('stashActor', {
+ actorId: this.actor.id,
+ stashId,
+ });
}
-async function unstashActor() {
- this.stashed = false;
-
- try {
- this.$store.dispatch('unstashActor', {
- actorId: this.actor.id,
- stashId: this.$store.getters.favorites.id,
- });
- } catch (error) {
- this.stashed = true;
- }
+async function unstashActor(stashId) {
+ this.stashedBy = await this.$store.dispatch('unstashActor', {
+ actorId: this.actor.id,
+ stashId,
+ });
}
function me() {
@@ -472,6 +454,7 @@ export default {
Releases,
Gender,
Social,
+ StashButton,
},
data() {
return {
@@ -483,6 +466,7 @@ export default {
bioExpanded: false,
photosExpanded: false,
stashed: false,
+ stashedBy: [],
};
},
computed: {
@@ -521,6 +505,10 @@ export default {
background: var(--profile);
}
+.actor-stash {
+ margin: 0 1rem 0 0;
+}
+
.header-name {
padding: .5rem 1rem;
margin: 0;
diff --git a/assets/components/stashes/button.vue b/assets/components/stashes/button.vue
index 6735668e..abe0f1ad 100644
--- a/assets/components/stashes/button.vue
+++ b/assets/components/stashes/button.vue
@@ -1,5 +1,5 @@
-
+