fix: bug que al inicio no se cargaban los posts

This commit is contained in:
2026-02-04 23:35:41 -03:00
parent 85477ffe7e
commit 7b91483514
4 changed files with 8 additions and 12 deletions

View File

@@ -50,13 +50,13 @@
<header class="border-b bg-background/95 backdrop-blur">
<div class="mx-4 ms-2 flex h-12 items-center justify-between">
<div class="flex items-center">
<a data-sveltekit-preload-data={false} href="/" class="mr-6 flex items-center space-x-2">
<button class="mr-6 flex items-center space-x-2" onclick={() => (window.location.href = '/')}>
<Avatar
class="h-8 w-8 transform rounded-sm! transition-transform duration-300 ease-in-out hover:scale-130 hover:rotate-12"
>
<AvatarImage src="/x.png" alt="minix" />
</Avatar>
</a>
</button>
<!-- <nav class="me-2 items-center space-x-6 text-sm font-medium md:flex">
<ButtonTheme />
</nav> -->

View File

@@ -1,5 +1,5 @@
import { get } from 'svelte/store';
import { page, loadingPosts, PAGE_SIZE } from '@/stores/posts';
import { page, loadingPosts, PAGE_SIZE, resetPosts } from '@/stores/posts';
import { appendPosts } from '@/stores/posts';
import { getPosts } from './getPosts';

View File

@@ -1,7 +1,7 @@
import { writable } from 'svelte/store';
import type { Post } from '../../types';
export const posts = writable<Post[]>([]);
export const posts = writable<Post[] | null>(null);
export const loadingPosts = writable(false);
export const page = writable(1);