Added extended heart button to actor component, fixed movie stash query.
This commit is contained in:
@@ -34,18 +34,11 @@
|
||||
class="header-social"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="me && stashed"
|
||||
icon="heart7"
|
||||
class="stash stashed noselect"
|
||||
@click="unstashActor"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="me && !stashed"
|
||||
icon="heart8"
|
||||
class="stash unstashed noselect"
|
||||
@click="stashActor"
|
||||
<StashButton
|
||||
:stashed-by="stashedBy"
|
||||
class="actor-stash light"
|
||||
@stash="(stash) => stashActor(stash)"
|
||||
@unstash="(stash) => unstashActor(stash)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user