mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-04-05 17:33:31 -04:00
no longer initializes embeddings model on startup
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
formatDate,
|
||||
type UserStats,
|
||||
} from "$lib/utils/stats";
|
||||
import { fetchStreak } from "$lib/utils/streak";
|
||||
|
||||
interface PageData {
|
||||
stats: UserStats | null;
|
||||
@@ -22,6 +23,7 @@
|
||||
let anonymousId = $state("");
|
||||
|
||||
let loading = $state(true);
|
||||
let currentStreak = $state(0);
|
||||
|
||||
function getOrCreateAnonymousId(): string {
|
||||
if (!browser) return "";
|
||||
@@ -36,6 +38,12 @@
|
||||
|
||||
onMount(async () => {
|
||||
anonymousId = getOrCreateAnonymousId();
|
||||
if (data.user?.id) {
|
||||
const localDate = new Date().toLocaleDateString("en-CA");
|
||||
currentStreak = await fetchStreak(data.user.id, localDate);
|
||||
} else {
|
||||
currentStreak = data.stats?.currentStreak ?? 0;
|
||||
}
|
||||
loading = false;
|
||||
});
|
||||
|
||||
@@ -151,7 +159,7 @@
|
||||
<div
|
||||
class="text-2xl md:text-3xl font-bold text-orange-400 mb-1"
|
||||
>
|
||||
{stats.currentStreak}
|
||||
{currentStreak}
|
||||
</div>
|
||||
<div
|
||||
class="text-xs md:text-sm text-gray-300 font-medium"
|
||||
|
||||
Reference in New Issue
Block a user