Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: improve item flash animation when revealing item in list

Abdullah Atta174bb9a935d0
diff --git a/apps/web/src/app.css b/apps/web/src/app.css
index 2ff637528..719f9ac15 100644
--- a/apps/web/src/app.css
+++ b/apps/web/src/app.css
@@ -206,7 +206,7 @@ textarea,
}
.flash {
- animation: flash 0.5s;
+ animation: flash 1s;
}
@keyframes flash {
diff --git a/apps/web/src/components/list-container/index.tsx b/apps/web/src/components/list-container/index.tsx
index 3969fc00d..9a0b09293 100644
--- a/apps/web/src/components/list-container/index.tsx
+++ b/apps/web/src/components/list-container/index.tsx
@@ -112,7 +112,7 @@ function ListContainer(props: ListContainerProps) {
let flashStartTimeout: NodeJS.Timeout;
let flashEndTimeout: NodeJS.Timeout;
- AppEventManager.subscribe(
+ const event = AppEventManager.subscribe(
AppEvents.revealItemInList,
async (id?: string) => {
if (!id || !listRef.current) return;
@@ -133,16 +133,17 @@ function ListContainer(props: ListContainerProps) {
noteItem.classList.add("flash");
flashEndTimeout = setTimeout(() => {
noteItem.classList.remove("flash");
- }, 1000);
+ }, 2000);
}, 500);
}
);
return () => {
+ event.unsubscribe();
clearTimeout(flashStartTimeout);
clearTimeout(flashEndTimeout);
};
- }, []);
+ }, [items]);
useEffect(() => {
return () => {