new publishing flow - s3 compatible
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import "dotenv/config";
|
||||
import { electronApp, optimizer, is } from "@electron-toolkit/utils";
|
||||
import { app, ipcMain, BrowserWindow, shell } from "electron";
|
||||
import { app, ipcMain, BrowserWindow, dialog, shell } from "electron";
|
||||
import filesystemPlugin from "@takerofnotes/plugin-filesystem";
|
||||
import supabasePlugin from "@takerofnotes/plugin-supabase";
|
||||
import s3Plugin from "@takerofnotes/plugin-s3";
|
||||
@@ -577,6 +577,12 @@ app.whenReady().then(async () => {
|
||||
);
|
||||
}
|
||||
});
|
||||
ipcMain.handle("open-directory-dialog", async () => {
|
||||
const result = await dialog.showOpenDialog({
|
||||
properties: ["openDirectory"]
|
||||
});
|
||||
return result.canceled ? null : result.filePaths[0];
|
||||
});
|
||||
electronApp.setAppUserModelId("com.electron");
|
||||
app.on("browser-window-created", (_, window) => {
|
||||
optimizer.watchWindowShortcuts(window);
|
||||
|
||||
@@ -38,6 +38,9 @@ const api = {
|
||||
},
|
||||
moveClosed: () => {
|
||||
ipcRenderer.invoke("move-closed");
|
||||
},
|
||||
openDirectoryDialog: () => {
|
||||
return ipcRenderer.invoke("open-directory-dialog");
|
||||
}
|
||||
};
|
||||
if (process.contextIsolated) {
|
||||
|
||||
Reference in New Issue
Block a user