Fixed heart menu stash creation.
This commit is contained in:
@@ -82,7 +82,8 @@
|
||||
|
||||
<StashDialog
|
||||
v-if="showStashDialog"
|
||||
@created="showStashDialog = false; reloadStashes();"
|
||||
@created="(newStash) => { showStashDialog = false; reloadStashes(newStash); }"
|
||||
@close="showStashDialog = false;"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -114,9 +115,10 @@ const props = defineProps({
|
||||
|
||||
const emit = defineEmits(['stashed', 'unstashed']);
|
||||
|
||||
const { user, pageProps } = inject('pageContext');
|
||||
const pageStash = pageProps.stash;
|
||||
const pageContext = inject('pageContext');
|
||||
const pageStash = pageContext.pageProps.stash;
|
||||
|
||||
const user = ref(pageContext.user);
|
||||
const itemStashes = ref(props.item.stashes);
|
||||
const hasSecondaryStash = computed(() => itemStashes.value.some((itemStash) => !itemStash.isPrimary));
|
||||
|
||||
@@ -192,10 +194,12 @@ function toggleShowStashes(state) {
|
||||
showStashes.value = !showStashes.value;
|
||||
}
|
||||
|
||||
async function reloadStashes() {
|
||||
const profile = await get(`/users/${user.id}`);
|
||||
async function reloadStashes(newStash) {
|
||||
const profile = await get(`/users/${user.value.id}`);
|
||||
|
||||
console.log(profile);
|
||||
user.value = profile;
|
||||
|
||||
await stashItem(newStash);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
<li class="menu-item create">
|
||||
<label
|
||||
v-close-popper
|
||||
class="menu-stash"
|
||||
@click="emit('create')"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user