diff --git a/src/lib/components/PostCard.svelte b/src/lib/components/PostCard.svelte
index bf7cb96..4ab90ca 100644
--- a/src/lib/components/PostCard.svelte
+++ b/src/lib/components/PostCard.svelte
@@ -30,13 +30,16 @@
import DialogDescription from './ui/dialog/dialog-description.svelte';
import { sesionStore } from '@/stores/usuario';
import { likePost } from '@/hooks/likePost';
+ import { goto } from '$app/navigation';
+ import { resolve } from '$app/paths';
interface postProp {
post: Post;
postAModificar: Post | null;
+ update?: Function;
}
- let { post, postAModificar = $bindable() }: postProp = $props();
+ let { post, postAModificar = $bindable(), update }: postProp = $props();
let cargandoBorrar = $state(false);
let mensajeError = $state('');
@@ -82,7 +85,7 @@
likePost(post),
new Promise((resolve) => setTimeout(resolve, 300))
]);
- console.log(1);
+ // console.log(1);
if (ok) {
if (post.isLiked) {
post.likesCount--;
@@ -94,9 +97,10 @@
errorLike = true;
mensajeError = message;
}
- console.log(1);
- updatePostStore(post.id, post);
- console.log(1);
+ // console.log(2);
+ if (update) update();
+ else updatePostStore(post.id, post);
+ // console.log(3);
cargandoLike = false;
}
@@ -157,7 +161,7 @@
{#if post.imageUrl}
-
+
@@ -179,7 +183,12 @@
{/if}
-