mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Fix @Tirokk's suggestions
Wow @Tirokk that was a good catch! I thought that the emitting side knows the `index`, but no, it only emits `removePostFromList` and that's it. In order to delete the right post, we have to pass in the `index` ourselves. So, the caller of the function is the page component itself. I didn't see the error myself, because in Javascript if you parse `undefined` or `null` as Integer, you get 0 and it does not raise an error.
This commit is contained in:
parent
585e798dc0
commit
2736738c36
@ -202,11 +202,11 @@
|
||||
|
||||
<template v-if="activePosts.length">
|
||||
<hc-post-card
|
||||
v-for="post in activePosts"
|
||||
v-for="(post, index) in activePosts"
|
||||
:key="post.id"
|
||||
:post="post"
|
||||
:width="{ base: '100%', md: '100%', xl: '50%' }"
|
||||
@removePostFromList="removePostFromList"
|
||||
@removePostFromList="removePostFromList(index)"
|
||||
/>
|
||||
</template>
|
||||
<template v-else-if="$apollo.loading">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user