Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ const JitsyMeeting: React.FC<JitsyMeetingProps> = ({
if (blob) {
const screenshotPayload = {
dataURL: blob,
timestamp: Date.now(),
timestamp: new Date().toISOString(),
userID: userId,
};

Expand Down Expand Up @@ -237,7 +237,7 @@ const JitsyMeeting: React.FC<JitsyMeetingProps> = ({
screenshots: [
{
dataURL: blob,
timestamp: Date.now(),
timestamp: new Date().toISOString(),
userID: userId,
},
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export default function MeetingAnalyticsOverlay({
}
>
<BigEmoji>{currentEmot.icon}</BigEmoji>
<Value>{currentEmot.val}%</Value>
<Value>{currentEmot.val ? `${currentEmot.val}%` : "-"}</Value>
</StatCard>
<StatCard
active={hoveredPanel === "attention"}
Expand Down Expand Up @@ -291,7 +291,7 @@ export default function MeetingAnalyticsOverlay({
</ResponsiveContainer>
</MiniChartBox>
<Value style={{ color: getColorByValue(latestAtt) }}>
{latestAtt}%
{latestAtt ? `${latestAtt}%` : "-"}
</Value>
</StatCard>
</StatsWrapper>
Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
9 changes: 2 additions & 7 deletions src/workers/saveImageWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export {};

export interface Screenshot {
dataURL: Blob;
timestamp: number;
timestamp: string;
userID: number;
}

Expand Down Expand Up @@ -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<SaveImagesMessage>) => {
if (event.data.apiUrl) {
API_URL = event.data.apiUrl;
Expand Down Expand Up @@ -82,7 +77,7 @@ self.onmessage = async (event: MessageEvent<SaveImagesMessage>) => {
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(
Expand Down
Loading