Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Fixes on tray timer

Ilya66cf28d41ad3
diff --git a/apps/desktop/src/components/windows/inner/Recorder.tsx b/apps/desktop/src/components/windows/inner/Recorder.tsx
index d7e385a0c..84c799729 100644
--- a/apps/desktop/src/components/windows/inner/Recorder.tsx
+++ b/apps/desktop/src/components/windows/inner/Recorder.tsx
@@ -308,7 +308,6 @@ export const Recorder = () => {
useEffect(() => {
let intervalId: NodeJS.Timeout;
- let previousHandleShown = false;
let shouldShowTimer = osType() !== "windows";
if (isRecording && !startingRecording) {
@@ -324,11 +323,8 @@ export const Recorder = () => {
// TODO: Maybe move to backend.
if (shouldShowTimer) {
setTrayTitle(
- toMonospaceUnicodeString(
- ` ${minutes}${previousHandleShown ? " " : ":"}${formattedSeconds}`
- )
+ toMonospaceUnicodeString(` ${minutes}:${formattedSeconds}`)
);
- previousHandleShown = !previousHandleShown;
}
}, 1000);
}
diff --git a/apps/desktop/src/utils/tray.ts b/apps/desktop/src/utils/tray.ts
index 9909f6302..fe181ae8a 100644
--- a/apps/desktop/src/utils/tray.ts
+++ b/apps/desktop/src/utils/tray.ts
@@ -99,8 +99,6 @@ export const setTrayStopIcon = async (showStopIcon: boolean) => {
await handle?.setIconAsTemplate(true);
};
-// let show = false;
-
export const setTrayTitle = async (title: string | null) => {
handle?.setTitle(title);
};
@@ -109,12 +107,3 @@ const selectDevice = (kind: DeviceKind, device: Device | null) =>
emit("cap://av/set-device", { type: kind, device: device }).catch((error) =>
console.log("Failed to emit cap://av/set-device event:", error)
);
-
-// const toMonospaceDigits = (num: number) => {
-// return num
-// .toString()
-// .padStart(2, "0")
-// .split("")
-// .map((char) => String.fromCodePoint(0x1d7f6 + parseInt(char, 10)))
-// .join("");
-// };