mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
fix: add missing trashDate field whenever a page is moved to the trash. (#1389)
Co-authored-by: himself65 <himself65@outlook.com>
This commit is contained in:
@@ -19,7 +19,9 @@ export const DateCell = ({
|
||||
const value = pageMeta[dateKey] ?? pageMeta[backupKey];
|
||||
return (
|
||||
<TableCell ellipsis={true} {...props}>
|
||||
{value ? dayjs(value as string).format('YYYY-MM-DD HH:mm') : '--'}
|
||||
{typeof value === 'number'
|
||||
? dayjs(value).format('YYYY-MM-DD HH:mm')
|
||||
: '--'}
|
||||
</TableCell>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -212,6 +212,7 @@ export const PageList: React.FC<PageListProps> = ({
|
||||
onToggleTrashPage={() => {
|
||||
helper.setPageMeta(pageMeta.id, {
|
||||
trash: !pageMeta.trash,
|
||||
trashDate: +new Date(),
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -97,7 +97,7 @@ const PopoverContent = () => {
|
||||
data-testid="editor-option-menu-delete"
|
||||
onClick={() => {
|
||||
// fixme(himself65): regression that don't have conform dialog
|
||||
setPageMeta(pageId, { trash: !trash });
|
||||
setPageMeta(pageId, { trash: !trash, trashDate: +new Date() });
|
||||
toast(t('Moved to Trash'));
|
||||
}}
|
||||
icon={<DeleteTemporarilyIcon />}
|
||||
|
||||
@@ -8,6 +8,7 @@ declare module '@blocksuite/store' {
|
||||
mode?: 'page' | 'edgeless';
|
||||
favorite?: boolean;
|
||||
trash?: boolean;
|
||||
trashDate?: number;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user