feat: recording url with 6 months expiry time (#18707)
* feat: store cal video recording on s3 * feat: create new route to fetch download link * tests: add unit test * fix: unit test * fix: type error * chore: add env var * fix: open in new tab * fix: type err * chore: update test * fix: import * chore: use cal video recording token secret --------- Co-authored-by: Syed Ali Shahbaz <[email protected]>
This commit is contained in:
1 parent
fc1d6ae402
commit
d9df9b3d01
8 files changed
+160
-21
No files matched your search
@@ -1,3 +1,5 @@
|
||||
"use client";
|
||||
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Suspense, useEffect, useState } from "react";
|
||||
|
||||
@@ -74,21 +76,19 @@ const useRecordingDownload = () => {
|
||||
useEffect(
|
||||
function refactorMeWithoutEffect() {
|
||||
if (data && data.download_link) {
|
||||
window.location.href = data.download_link;
|
||||
window.open(data.download_link, "_blank", "noopener,noreferrer");
|
||||
}
|
||||
},
|
||||
[data]
|
||||
);
|
||||
return {
|
||||
setRecordingId: (newRecordingId: string) => {
|
||||
// may be a way to do this by default, but this is easy enough.
|
||||
if (recordingId === newRecordingId && data) {
|
||||
window.location.href = data.download_link;
|
||||
window.open(data.download_link, "_blank", "noopener,noreferrer");
|
||||
}
|
||||
if (!isFetching) {
|
||||
setRecordingId(newRecordingId);
|
||||
}
|
||||
// assume it is still fetching, do nothing.
|
||||
},
|
||||
isFetching,
|
||||
recordingId,
|
||||
|
||||
Reference in new issue
Block a user