Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
Change where the toggle-recording event emits and fix a small issue.
Ilya1492360f8c8a
diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rsindex caa0009e4..9ec5eabfa 100644--- a/apps/desktop/src-tauri/src/main.rs+++ b/apps/desktop/src-tauri/src/main.rs@@ -205,15 +205,15 @@ fn main() {app.manage(Arc::new(Mutex::new(recording_state)));- let handle = app.tray_handle().clone();+ let tray_handle = app.tray_handle().clone();app.listen_global("toggle-recording", move|event| {let payload_error_msg = format!("Error while deserializing recording state from event payload: {:?}", event.payload());let recording_state: Value = serde_json::from_str(event.payload().expect(payload_error_msg.as_str())).unwrap();if recording_state.as_bool().expect(payload_error_msg.as_str()) {- handle.set_icon(tauri::Icon::Raw(include_bytes!("../icons/tray-stop-icon.png").to_vec())).unwrap();+ tray_handle.set_icon(tauri::Icon::Raw(include_bytes!("../icons/tray-stop-icon.png").to_vec())).unwrap();} else {- handle.set_icon(tauri::Icon::Raw(include_bytes!("../icons/tray-default-icon.png").to_vec())).unwrap();+ tray_handle.set_icon(tauri::Icon::Raw(include_bytes!("../icons/tray-default-icon.png").to_vec())).unwrap();}});diff --git a/apps/desktop/src/components/windows/inner/Recorder.tsx b/apps/desktop/src/components/windows/inner/Recorder.tsxindex 6ef8563ad..1c90e4cc3 100644--- a/apps/desktop/src/components/windows/inner/Recorder.tsx+++ b/apps/desktop/src/components/windows/inner/Recorder.tsx@@ -197,8 +197,7 @@ export const Recorder = () => {},}).catch((error) => {console.error("Error invoking start_screen_recording:", error);- });- emit("toggle-recording", true);+ }).then(() => emit("toggle-recording", true));};const handleStartAllRecordings = async () => {@@ -261,6 +260,7 @@ export const Recorder = () => {setIsRecording(false);setHasStartedRecording(false);setStoppingRecording(false);+ setCanStopRecording(false);emit("toggle-recording", false);} catch (error) {console.error("Error stopping recording:", error);