From 740bc4bb3c454b59b4e145524c45ba1aab9ceb3e Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 18 May 2024 12:25:45 +0200 Subject: [PATCH] Sidebar even faster + fix error message about creation time not being available --- .../ribbon/react/containers/ribbon/logic.ts | 30 +++++++++---------- .../components/AnnotationsSidebar.tsx | 8 ++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/in-page-ui/ribbon/react/containers/ribbon/logic.ts b/src/in-page-ui/ribbon/react/containers/ribbon/logic.ts index ce66df404f..a691001809 100644 --- a/src/in-page-ui/ribbon/react/containers/ribbon/logic.ts +++ b/src/in-page-ui/ribbon/react/containers/ribbon/logic.ts @@ -221,21 +221,21 @@ export class RibbonContainerLogic extends UILogic< }) try { - const signupDate = new Date( - await (await this.dependencies.authBG.getCurrentUser()) - .creationTime, - ).getTime() - const isTrial = - (await enforceTrialPeriod30Days( - this.dependencies.browserAPIs, - signupDate, - )) ?? null - - if (isTrial) { - this.emitMutation({ - isTrial: { $set: isTrial }, - signupDate: { $set: signupDate }, - }) + const currentUser = await this.dependencies.authBG.getCurrentUser() + if (currentUser) { + const signupDate = new Date(currentUser?.creationTime).getTime() + const isTrial = + (await enforceTrialPeriod30Days( + this.dependencies.browserAPIs, + signupDate, + )) ?? null + + if (isTrial) { + this.emitMutation({ + isTrial: { $set: isTrial }, + signupDate: { $set: signupDate }, + }) + } } } catch (error) { console.error('error in updatePageCounter', error) diff --git a/src/sidebar/annotations-sidebar/components/AnnotationsSidebar.tsx b/src/sidebar/annotations-sidebar/components/AnnotationsSidebar.tsx index b6a4fe168d..6c278a24e8 100644 --- a/src/sidebar/annotations-sidebar/components/AnnotationsSidebar.tsx +++ b/src/sidebar/annotations-sidebar/components/AnnotationsSidebar.tsx @@ -4715,7 +4715,7 @@ const AnnotationContainer = styled(Margin)` } animation-name: ${sidebarContentOpen}; - animation-duration: 800ms; + animation-duration: 200ms; animation-timing-function: cubic-bezier(0.3, 0.35, 0.14, 0.8); animation-fill-mode: both; ` @@ -4733,11 +4733,11 @@ const AnnotationBox = styled.div<{ width: 100%; z-index: ${(props) => props.zIndex}; - animation-name: ${openAnimation}; - animation-duration: 600ms; + /* animation-name: ${openAnimation}; + animation-duration: 100ms; animation-delay: ${(props) => props.order * 20}ms; animation-timing-function: cubic-bezier(0.3, 0.35, 0.14, 0.8); - animation-fill-mode: forwards; + animation-fill-mode: forwards; */ position: relative; margin-bottom: 5px; `