mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update image displays (#2093)
This commit is contained in:
@ -66,6 +66,7 @@ const Memo: React.FC<Props> = (props: Props) => {
|
||||
);
|
||||
}, [memo.relationList]);
|
||||
|
||||
// Update display time string.
|
||||
useEffect(() => {
|
||||
let intervalFlag: any = -1;
|
||||
if (Date.now() - memo.displayTs < 1000 * 60 * 60 * 24) {
|
||||
@ -102,6 +103,11 @@ const Memo: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
}, [lazyRendering]);
|
||||
|
||||
if (!shouldRender) {
|
||||
// Render a placeholder to occupy the space.
|
||||
return <div className={`memo-wrapper min-h-[128px] ${"memos-" + memo.id}`} ref={memoContainerRef}></div>;
|
||||
}
|
||||
|
||||
const handleTogglePinMemoBtnClick = async () => {
|
||||
try {
|
||||
if (memo.pinned) {
|
||||
@ -246,15 +252,6 @@ const Memo: React.FC<Props> = (props: Props) => {
|
||||
}
|
||||
};
|
||||
|
||||
if (!shouldRender) {
|
||||
return (
|
||||
<div
|
||||
className={`memo-wrapper min-h-[128px] ${"memos-" + memo.id} ${memo.pinned && !readonly ? "pinned" : ""}`}
|
||||
ref={memoContainerRef}
|
||||
></div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className={`memo-wrapper ${"memos-" + memo.id} ${memo.pinned && !readonly ? "pinned" : ""}`} ref={memoContainerRef}>
|
||||
|
Reference in New Issue
Block a user