A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search
fix: fix wrapped feature to only show bookmarks in 2025
Mohamed Bassem4077e2863e5f
diff --git a/packages/trpc/models/users.ts b/packages/trpc/models/users.tsindex b1719200..5d3c3785 100644--- a/packages/trpc/models/users.ts+++ b/packages/trpc/models/users.ts@@ -872,12 +872,22 @@ export class User {}async hasWrapped(): Promise<boolean> {+ // Check for bookmarks created in 2025+ const yearStart = new Date("2025-01-01T00:00:00Z");+ const yearEnd = new Date("2025-12-31T23:59:59Z");+const [{ numBookmarks }] = await this.ctx.db.select({numBookmarks: count(bookmarks.id),}).from(bookmarks)- .where(eq(bookmarks.userId, this.user.id));+ .where(+ and(+ eq(bookmarks.userId, this.user.id),+ gte(bookmarks.createdAt, yearStart),+ lte(bookmarks.createdAt, yearEnd),+ ),+ );return numBookmarks >= 20;}