diff --git a/src/components/Consultations/ConsultationCard/JitsyMeeting/index.tsx b/src/components/Consultations/ConsultationCard/JitsyMeeting/index.tsx index 233459b9..f7882b6c 100644 --- a/src/components/Consultations/ConsultationCard/JitsyMeeting/index.tsx +++ b/src/components/Consultations/ConsultationCard/JitsyMeeting/index.tsx @@ -204,7 +204,7 @@ const JitsyMeeting: React.FC = ({ if (blob) { const screenshotPayload = { dataURL: blob, - timestamp: Date.now(), + timestamp: new Date().toISOString(), userID: userId, }; @@ -237,7 +237,7 @@ const JitsyMeeting: React.FC = ({ screenshots: [ { dataURL: blob, - timestamp: Date.now(), + timestamp: new Date().toISOString(), userID: userId, }, ], diff --git a/src/components/MeetingAnalyticsOverlay/MeetingAnalyticsOverlay.tsx b/src/components/MeetingAnalyticsOverlay/MeetingAnalyticsOverlay.tsx index 3ae275bd..856b44e6 100644 --- a/src/components/MeetingAnalyticsOverlay/MeetingAnalyticsOverlay.tsx +++ b/src/components/MeetingAnalyticsOverlay/MeetingAnalyticsOverlay.tsx @@ -256,7 +256,7 @@ export default function MeetingAnalyticsOverlay({ } > {currentEmot.icon} - {currentEmot.val}% + {currentEmot.val ? `${currentEmot.val}%` : "-"} - {latestAtt}% + {latestAtt ? `${latestAtt}%` : "-"} diff --git a/src/utils/index.ts b/src/utils/index.ts index 24790420..732076d1 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -387,7 +387,7 @@ export const relativeTimeFormatter = new Intl.RelativeTimeFormat("pl", { style: "short", }); -export const getDateParts = (timestamp: number) => { +export const getDateParts = (timestamp: string) => { const date = new Date(timestamp); const pad = (n: number) => n.toString().padStart(2, "0"); diff --git a/src/workers/saveImageWorker.ts b/src/workers/saveImageWorker.ts index e4881c94..c495840c 100644 --- a/src/workers/saveImageWorker.ts +++ b/src/workers/saveImageWorker.ts @@ -4,7 +4,7 @@ export {}; export interface Screenshot { dataURL: Blob; - timestamp: number; + timestamp: string; userID: number; } @@ -48,11 +48,6 @@ function getFormattedFilename(screenshot: Screenshot, modelId: number): string { return `${screenshot.userID}_${modelId}_${ts}.webp`; } -const formatToSQL = (timestamp: number) => { - const p = getDateParts(timestamp); - return `${p.yy}-${p.mm}-${p.dd} ${p.hh}:${p.mi}:${p.ss}`; -}; - self.onmessage = async (event: MessageEvent) => { if (event.data.apiUrl) { API_URL = event.data.apiUrl; @@ -82,7 +77,7 @@ self.onmessage = async (event: MessageEvent) => { const filename = getFormattedFilename(s, modelId); const file = new File([s.dataURL], filename, { type: "image/webp" }); formData.append(`files[${index}][file]`, file, filename); - formData.append(`files[${index}][timestamp]`, formatToSQL(s.timestamp)); + formData.append(`files[${index}][timestamp]`, s.timestamp); }); const response = await fetch(