Compare commits

..

No commits in common. "ad635d4192f97a54e4876d105e91897d15dc9185" and "23a6a60f796df35079ea601994a1e69273ba3bd1" have entirely different histories.

6 changed files with 21 additions and 27 deletions

View File

@ -2,7 +2,7 @@
<div <div
class="tile" class="tile"
:class="{ :class="{
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id, unstashed: !favorited && pageStash && user && pageStash.id === user.primaryStash?.id
}" }"
> >
<span class="name">{{ actor.name }}</span> <span class="name">{{ actor.name }}</span>
@ -33,8 +33,8 @@
:item="actor" :item="actor"
:show-secondary="false" :show-secondary="false"
class="light tiled" class="light tiled"
@stashed="(stash) => { favorited = stash.id === currentStash.id ? true : favorited; }" @stashed="(stash) => { favorited = stash.isPrimary ? true : favorited; }"
@unstashed="(stash) => { favorited = stash.id === currentStash.id ? false : favorited; }" @unstashed="(stash) => { favorited = stash.isPrimary ? false : favorited; }"
/> />
</div> </div>
@ -88,9 +88,8 @@ const props = defineProps({
const pageContext = inject('pageContext'); const pageContext = inject('pageContext');
const { user } = pageContext; const { user } = pageContext;
const pageStash = pageContext.pageProps.stash; const pageStash = pageContext.pageProps.stash;
const currentStash = pageStash || user.primaryStash;
const favorited = ref(props.actor.stashes.some((actorStash) => actorStash.id === currentStash.id)); const favorited = ref(props.actor.stashes?.some((sceneStash) => sceneStash.isPrimary) || false);
</script> </script>
<style scoped> <style scoped>

View File

@ -1,9 +1,7 @@
<template> <template>
<div <div
class="movie-tile" class="movie-tile"
:class="{ :class="{ unstashed: !favorited && pageStash && user && pageStash.id === user.primaryStash?.id }"
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id,
}"
> >
<div <div
class="cover-container" class="cover-container"
@ -33,8 +31,8 @@
:item="movie" :item="movie"
:show-secondary="false" :show-secondary="false"
class="light tiled" class="light tiled"
@stashed="(stash) => { favorited = stash.id === currentStash.id ? true : favorited; }" @stashed="(stash) => { favorited = stash.isPrimary ? true : favorited; }"
@unstashed="(stash) => { favorited = stash.id === currentStash.id ? false : favorited; }" @unstashed="(stash) => { favorited = stash.isPrimary ? false : favorited; }"
/> />
</div> </div>
@ -120,11 +118,10 @@ const props = defineProps({
const pageContext = inject('pageContext'); const pageContext = inject('pageContext');
const user = pageContext.user; const user = pageContext.user;
const pageStash = pageContext.pageProps.stash; const pageStash = pageContext.pageProps.stash;
const currentStash = pageStash || user.primaryStash;
const currentYear = new Date().getFullYear(); const currentYear = new Date().getFullYear();
const favorited = ref(props.movie.stashes.some((movieStash) => movieStash.id === currentStash.id)); const favorited = ref(props.movie.stashes.some((sceneStash) => sceneStash.isPrimary));
</script> </script>
<style scoped> <style scoped>

View File

@ -2,7 +2,7 @@
<div <div
class="tile" class="tile"
:class="{ :class="{
unstashed: !favorited && pageStash && user && pageStash.user.id === user.id, unstashed: !favorited && pageStash && user && pageStash.id === user.primaryStash?.id,
'is-new': scene.isNew, 'is-new': scene.isNew,
}" }"
> >
@ -32,8 +32,8 @@
:item="scene" :item="scene"
:show-secondary="false" :show-secondary="false"
class="light tiled" class="light tiled"
@stashed="(stash) => { favorited = stash.id === currentStash.id ? true : favorited; }" @stashed="(stash) => { favorited = stash.isPrimary ? true : favorited; }"
@unstashed="(stash) => { favorited = stash.id === currentStash.id ? false : favorited; }" @unstashed="(stash) => { favorited = stash.isPrimary ? false : favorited; }"
/> />
<span <span
@ -126,9 +126,8 @@ const props = defineProps({
const pageContext = inject('pageContext'); const pageContext = inject('pageContext');
const user = pageContext.user; const user = pageContext.user;
const pageStash = pageContext.pageProps.stash; const pageStash = pageContext.pageProps.stash;
const currentStash = pageStash || user.primaryStash;
const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.id === currentStash.id)); const favorited = ref(props.scene.stashes.some((sceneStash) => sceneStash.isPrimary));
</script> </script>
<style scoped> <style scoped>

View File

@ -29,17 +29,17 @@
</VDropdown> </VDropdown>
<Icon <Icon
v-if="itemStashes.some((itemStash) => itemStash.id === currentStash.id)" v-if="itemStashes.some((itemStash) => itemStash.isPrimary)"
:icon="currentStash.isPrimary ? 'heart7' : 'folder-heart'" icon="heart7"
class="heart favorited noselect" class="heart favorited noselect"
@click.native.stop="unstashItem(currentStash)" @click.native.stop="unstashItem(user.primaryStash)"
/> />
<Icon <Icon
v-else v-else
:icon="currentStash.isPrimary ? 'heart8' : 'folder-heart'" icon="heart8"
class="heart noselect" class="heart noselect"
@click.native.stop="stashItem(currentStash)" @click.native.stop="stashItem(user.primaryStash)"
/> />
</div> </div>
</template> </template>
@ -70,8 +70,7 @@ const props = defineProps({
const emit = defineEmits(['stashed', 'unstashed']); const emit = defineEmits(['stashed', 'unstashed']);
const { user, pageProps } = inject('pageContext'); const { user } = inject('pageContext');
const currentStash = pageProps.stash || user.primaryStash;
const itemStashes = ref(props.item.stashes); const itemStashes = ref(props.item.stashes);

4
package-lock.json generated
View File

@ -1,11 +1,11 @@
{ {
"name": "traxxx-web", "name": "traxxx-web",
"version": "0.17.1", "version": "0.17.0",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"version": "0.17.1", "version": "0.17.0",
"dependencies": { "dependencies": {
"@brillout/json-serializer": "^0.5.8", "@brillout/json-serializer": "^0.5.8",
"@dicebear/collection": "^7.0.5", "@dicebear/collection": "^7.0.5",

View File

@ -72,5 +72,5 @@
"postcss-custom-media": "^10.0.2", "postcss-custom-media": "^10.0.2",
"postcss-nesting": "^12.0.2" "postcss-nesting": "^12.0.2"
}, },
"version": "0.17.1" "version": "0.17.0"
} }