From 44fadf6962bc2a8f9abe8f574d15e3bb9e5f413c Mon Sep 17 00:00:00 2001 From: brentyi Date: Wed, 11 Dec 2024 22:44:15 +0000 Subject: [PATCH 1/2] Fix file upload notification --- src/viser/client/package.json | 12 +- .../client/src/components/UploadButton.tsx | 6 +- src/viser/client/yarn.lock | 154 ++++++++++-------- 3 files changed, 93 insertions(+), 79 deletions(-) diff --git a/src/viser/client/package.json b/src/viser/client/package.json index 5055c3053..e4151bd30 100644 --- a/src/viser/client/package.json +++ b/src/viser/client/package.json @@ -3,12 +3,12 @@ "version": "0.1.0", "private": true, "dependencies": { - "@mantine/core": "^7.6.2", - "@mantine/dates": "^7.6.2", - "@mantine/form": "^7.13.5", - "@mantine/hooks": "^7.6.2", - "@mantine/notifications": "^7.6.2", - "@mantine/vanilla-extract": "^7.6.2", + "@mantine/core": "^7.15.0", + "@mantine/dates": "^7.15.0", + "@mantine/form": "^7.15.0", + "@mantine/hooks": "^7.15.0", + "@mantine/notifications": "^7.15.0", + "@mantine/vanilla-extract": "^7.15.0", "@mdx-js/mdx": "^3.0.1", "@mdx-js/react": "^3.0.1", "@msgpack/msgpack": "^3.0.0-beta2", diff --git a/src/viser/client/src/components/UploadButton.tsx b/src/viser/client/src/components/UploadButton.tsx index 40aa0f60a..5cc38447d 100644 --- a/src/viser/client/src/components/UploadButton.tsx +++ b/src/viser/client/src/components/UploadButton.tsx @@ -95,8 +95,9 @@ function useFileUpload({ const { notificationId, filename } = uploadState; if (uploadState.uploadedBytes === 0) { // Show notification. + console.log("Show notification", notificationId); notifications.show({ - uuid: notificationId, + id: notificationId, title: "Uploading " + `${filename} (${totalBytesString})`, message: , autoClose: false, @@ -107,8 +108,9 @@ function useFileUpload({ // Update progress. const progressValue = uploadState.uploadedBytes / uploadState.totalBytes; const isDone = progressValue === 1.0; + console.log("Update?", notificationId); notifications.update({ - uuid: notificationId, + id: notificationId, title: "Uploading " + `${filename} (${totalBytesString})`, message: !isDone ? ( Date: Wed, 11 Dec 2024 22:44:59 +0000 Subject: [PATCH 2/2] Remove unused logs --- src/viser/client/src/components/UploadButton.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/viser/client/src/components/UploadButton.tsx b/src/viser/client/src/components/UploadButton.tsx index 5cc38447d..9c95a390e 100644 --- a/src/viser/client/src/components/UploadButton.tsx +++ b/src/viser/client/src/components/UploadButton.tsx @@ -95,7 +95,6 @@ function useFileUpload({ const { notificationId, filename } = uploadState; if (uploadState.uploadedBytes === 0) { // Show notification. - console.log("Show notification", notificationId); notifications.show({ id: notificationId, title: "Uploading " + `${filename} (${totalBytesString})`, @@ -108,7 +107,6 @@ function useFileUpload({ // Update progress. const progressValue = uploadState.uploadedBytes / uploadState.totalBytes; const isDone = progressValue === 1.0; - console.log("Update?", notificationId); notifications.update({ id: notificationId, title: "Uploading " + `${filename} (${totalBytesString})`,