diff --git a/web/src/components/Settings/PreferencesSection.tsx b/web/src/components/Settings/PreferencesSection.tsx index f3f825b6..d9b5c7e2 100644 --- a/web/src/components/Settings/PreferencesSection.tsx +++ b/web/src/components/Settings/PreferencesSection.tsx @@ -42,10 +42,10 @@ const PreferencesSection: React.FC = () => { for (const memo of memoList) { const content = memo.content || ""; - const createdAt = utils.getDateTimeString(memo.createdTs || Date.now()); + const createdTs = (memo as any).createdAt || memo.createdTs || Date.now(); try { - await memoService.importMemo(content, createdAt); + await memoService.importMemo(content, createdTs); succeedAmount++; } catch (error) { // do nth diff --git a/web/src/services/memoService.ts b/web/src/services/memoService.ts index cddf2741..4819c21b 100644 --- a/web/src/services/memoService.ts +++ b/web/src/services/memoService.ts @@ -129,12 +129,10 @@ const memoService = { await api.unpinMemo(memoId); }, - importMemo: async (content: string, createdAt: string) => { - const createdTs = Math.floor(utils.getTimeStampByDate(createdAt) / 1000); - + importMemo: async (content: string, createdTs: TimeStamp) => { await api.createMemo({ content, - createdTs, + createdTs: Math.floor(utils.getTimeStampByDate(createdTs) / 1000), }); }, };