Using different icon and fixed unstash fade in secondary stashes.

This commit is contained in:
2024-03-27 03:05:32 +01:00
parent 23a6a60f79
commit 105972b3d4
4 changed files with 24 additions and 18 deletions

View File

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