aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-client/src/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-client/src/main.js')
-rw-r--r--packages/meshbay-client/src/main.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/meshbay-client/src/main.js b/packages/meshbay-client/src/main.js
index 6228189..0ed06d9 100644
--- a/packages/meshbay-client/src/main.js
+++ b/packages/meshbay-client/src/main.js
@@ -505,6 +505,7 @@ function registerBridge() {
// The renderer still never names a path. It asks; the user chooses once; the
// main process holds the handle and the renderer refers to it by an opaque id.
const sinks = new Map();
+ const completedPaths = new Map();
let sinkId = 0;
/** `name`, or the first "name (n).ext" that is not taken — never an overwrite. */
@@ -611,10 +612,18 @@ function registerBridge() {
const sink = sinks.get(String(id));
if (!sink) return false;
sinks.delete(String(id));
+ completedPaths.set(String(id), sink.path);
await new Promise((resolve) => sink.stream.end(resolve));
return true;
});
+ ipcMain.handle('save:open', async (_e, id) => {
+ const p = completedPaths.get(String(id));
+ if (!p) return false;
+ await shell.openPath(p);
+ return true;
+ });
+
ipcMain.handle('save:abort', async (_e, id) => {
const sink = sinks.get(String(id));
if (!sink) return false;