Skip to content

Commit dea3a17

Browse files
author
Ritika Mishra
committed
updated ui and frame logic
1 parent 71a463a commit dea3a17

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/components/Canvas.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const Canvas = forwardRef(
7272

7373
useEffect(() => {
7474
setNumX(getpoints(selectedBits) * currentValue);
75-
console.log(numX);
7675
}, [samplingRate, currentValue]);
7776

7877
const prevCanvasCountRef = useRef<number>(canvasCount);

src/components/Connection.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ const Connection: React.FC<ConnectionProps> = ({
270270

271271
if (zipBlob) {
272272
saveAs(zipBlob, 'ChordsWeb.zip');
273+
toast.success("File downloaded suceesfully.")
273274
} else if (error) {
274275
console.error(error);
275276
}
@@ -821,6 +822,7 @@ const Connection: React.FC<ConnectionProps> = ({
821822

822823
transaction.oncomplete = () => {
823824
console.log("File deletion transaction completed.");
825+
toast.success("File deleted successfully.");
824826
};
825827

826828
transaction.onerror = () => {
@@ -909,20 +911,20 @@ const Connection: React.FC<ConnectionProps> = ({
909911
{/* Left-aligned section */}
910912
<div className="absolute left-4 flex items-center mx-0 px-0 space-x-1">
911913
{isRecordingRef.current && (
912-
<div className="flex items-center space-x-1 w-min ml-2">
913-
<button className="flex items-center justify-center px-3 py-2 select-none min-w-20 bg-primary text-destructive whitespace-nowrap rounded-xl"
914+
<div className="flex items-center space-x-1 w-min">
915+
<button className="flex items-center justify-center px-1 py-2 select-none min-w-20 bg-primary text-destructive whitespace-nowrap rounded-xl"
914916
>
915917
{formatTime(recordingElapsedTime)}
916918
</button>
917-
<Separator orientation="vertical" className="bg-primary h-9 ml-2" />
919+
<Separator orientation="vertical" className="bg-primary h-9 " />
918920
<div>
919921
<Popover
920922
open={isEndTimePopoverOpen}
921923
onOpenChange={setIsEndTimePopoverOpen}
922924
>
923925
<PopoverTrigger asChild>
924926
<Button
925-
className="flex items-center justify-center px-3 py-2 select-none min-w-12 text-destructive whitespace-nowrap rounded-xl"
927+
className="flex items-center justify-center px-1 py-2 select-none min-w-10 text-destructive whitespace-nowrap rounded-xl"
926928
variant="destructive"
927929
>
928930
{endTimeRef.current === null ? (
@@ -987,7 +989,7 @@ const Connection: React.FC<ConnectionProps> = ({
987989
<TooltipProvider>
988990
<Tooltip>
989991
<TooltipTrigger asChild>
990-
<Button className="flex items-center justify-center gap-1 py-2 px-6 sm:py-3 sm:px-8 rounded-xl font-semibold" onClick={handleClick}>
992+
<Button className="flex items-center justify-center gap-1 py-2 px-2 sm:py-3 sm:px-4 rounded-xl font-semibold" onClick={handleClick}>
991993
{isConnected ? (
992994
<>
993995
Disconnect

workers/indexedDBWorker.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import JSZip from 'jszip';
2+
import { toast } from "sonner";
23
let canvasCount = 0;
34
self.onmessage = async (event) => {
45
const { action, data, filename} = event.data;
@@ -172,6 +173,7 @@ const saveAllDataAsZip = async (canvasCount: number): Promise<Blob> => {
172173
console.error(`Error processing record ${record.filename}:`, error);
173174
}
174175
});
176+
toast.success("Data successfully downloaded as ZIP.");
175177

176178
const content = await zip.generateAsync({ type: "blob" });
177179
return content;

0 commit comments

Comments
 (0)