fix(timestamps): use seconds for created_at fallbacks; UI date formatting remains ms-converted

This commit is contained in:
Gigi
2025-10-02 22:30:31 +02:00
parent 2696bdb57a
commit 1b41b6e823
2 changed files with 3 additions and 3 deletions

View File

@@ -60,7 +60,7 @@ export const processApplesauceBookmarks = (
return allItems.map((bookmark: BookmarkData) => ({
id: bookmark.id || `${isPrivate ? 'private' : 'public'}-${Date.now()}`,
content: bookmark.content || '',
created_at: bookmark.created_at || Date.now(),
created_at: bookmark.created_at || Math.floor(Date.now() / 1000),
pubkey: activeAccount.pubkey,
kind: bookmark.kind || 30001,
tags: bookmark.tags || [],
@@ -74,7 +74,7 @@ export const processApplesauceBookmarks = (
return bookmarkArray.map((bookmark: BookmarkData) => ({
id: bookmark.id || `${isPrivate ? 'private' : 'public'}-${Date.now()}`,
content: bookmark.content || '',
created_at: bookmark.created_at || Date.now(),
created_at: bookmark.created_at || Math.floor(Date.now() / 1000),
pubkey: activeAccount.pubkey,
kind: bookmark.kind || 30001,
tags: bookmark.tags || [],

View File

@@ -120,7 +120,7 @@ export const fetchBookmarks = async (
title: `Bookmarks (${sortedBookmarks.length})`,
url: '',
content: latestContent,
created_at: newestCreatedAt || Date.now(),
created_at: newestCreatedAt || Math.floor(Date.now() / 1000),
tags: allTags,
bookmarkCount: sortedBookmarks.length,
eventReferences: allTags.filter((tag: string[]) => tag[0] === 'e').map((tag: string[]) => tag[1]),