From 1e470cf70b5990c09cea346393bb1eecfaf2d997 Mon Sep 17 00:00:00 2001 From: Martichou Date: Thu, 7 Mar 2024 20:15:35 +0100 Subject: [PATCH] feat: add file selector to send Signed-off-by: Martichou --- frontend/src-tauri/Cargo.lock | 4 ++-- frontend/src/components/HomePage.vue | 35 ++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/frontend/src-tauri/Cargo.lock b/frontend/src-tauri/Cargo.lock index 777f375..879057d 100644 --- a/frontend/src-tauri/Cargo.lock +++ b/frontend/src-tauri/Cargo.lock @@ -3932,7 +3932,7 @@ dependencies = [ [[package]] name = "rqs_lib" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "base64 0.21.7", @@ -3968,7 +3968,7 @@ dependencies = [ [[package]] name = "rquickshare" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anyhow", "fern", diff --git a/frontend/src/components/HomePage.vue b/frontend/src/components/HomePage.vue index 5bb4a26..7af7263 100644 --- a/frontend/src/components/HomePage.vue +++ b/frontend/src/components/HomePage.vue @@ -162,6 +162,12 @@

Drop files to send

+
+ + + + Select +
{ + let elem; + if (el === null) { + return; + } + + console.log("Selected", el); + if (el instanceof Array) { + console.log("Is an array"); + elem = el; + } else { + console.log("Is not an array"); + elem = [el]; + } + + + this.outboundPayload = { + Files: elem + } as OutboundPayload; + if (!this.discoveryRunning) await invoke('start_discovery'); + this.discoveryRunning = true; + }) } }, }