From 3ab9a43237dd25635ac316bffad5ec372f5b60ba Mon Sep 17 00:00:00 2001 From: Oliver Sauter Date: Wed, 27 Mar 2024 13:38:38 +0100 Subject: [PATCH] fix timestamp not being properly concatenated --- external/@worldbrain/memex-common | 2 +- src/annotations/components/AnnotationCreate.tsx | 3 ++- src/search-injection/components/youtubeActionBar.tsx | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/external/@worldbrain/memex-common b/external/@worldbrain/memex-common index f0f11d57ca..545590b9fb 160000 --- a/external/@worldbrain/memex-common +++ b/external/@worldbrain/memex-common @@ -1 +1 @@ -Subproject commit f0f11d57ca4ad030fd0c78122ee28242a9344dcc +Subproject commit 545590b9fbdc4d9c8bcb94f580c666a620f306c3 diff --git a/src/annotations/components/AnnotationCreate.tsx b/src/annotations/components/AnnotationCreate.tsx index 58e0fb595c..4907c1303b 100644 --- a/src/annotations/components/AnnotationCreate.tsx +++ b/src/annotations/components/AnnotationCreate.tsx @@ -114,13 +114,14 @@ export class AnnotationCreate extends React.Component const youtubeSummariseEvents = this.props.sidebarEvents youtubeSummariseEvents.on( 'triggerYoutubeTimestampSummary', - ({ text, showLoadingSpinner }, callback) => { + async ({ text, showLoadingSpinner }, callback) => { if (!this.editor) { callback(false) // signal that listener isn't ready return } if (text) { + await sleepPromise(50) this.editor?.addYoutubeTimestampWithText( text, showLoadingSpinner, diff --git a/src/search-injection/components/youtubeActionBar.tsx b/src/search-injection/components/youtubeActionBar.tsx index 0ce6ad3f10..1152bde6a1 100644 --- a/src/search-injection/components/youtubeActionBar.tsx +++ b/src/search-injection/components/youtubeActionBar.tsx @@ -223,7 +223,7 @@ export default class YoutubeButtonMenu extends React.Component { } else { let video = document.getElementsByTagName('video')[0] if (video) { - let currentTime = video.currentTime + let currentTime = Math.floor(video.currentTime) const currentTimeStamp = this.createTimestampAndURL( currentUrl, currentTime,