diff --git a/package.json b/package.json index 6c3a6c548..38c6217e6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ente", "productName": "ente", - "version": "1.6.24-alpha.2", + "version": "1.6.24-alpha.4", "private": true, "description": "Desktop client for ente.io", "main": "app/main.js", diff --git a/src/api/common.ts b/src/api/common.ts index 376ecfdb7..cb63248cb 100644 --- a/src/api/common.ts +++ b/src/api/common.ts @@ -18,6 +18,15 @@ export const getAppVersion = async (): Promise => { } }; +export const openDirectory = async (dirPath: string): Promise => { + try { + await ipcRenderer.invoke('open-dir', dirPath); + } catch (e) { + logError(e, 'error while opening directory'); + throw e; + } +}; + export { logToDisk, openLogDirectory, diff --git a/src/api/export.ts b/src/api/export.ts index 7af48ee24..b5615a007 100644 --- a/src/api/export.ts +++ b/src/api/export.ts @@ -6,7 +6,7 @@ export const exists = (path: string) => { return fs.existsSync(path); }; -export const checkExistsAndCreateCollectionDir = async (dirPath: string) => { +export const checkExistsAndCreateDir = async (dirPath: string) => { if (!fs.existsSync(dirPath)) { await fs.mkdir(dirPath); } diff --git a/src/preload.ts b/src/preload.ts index e07fa0961..13eec242c 100644 --- a/src/preload.ts +++ b/src/preload.ts @@ -28,7 +28,7 @@ import { getEncryptionKey, setEncryptionKey } from './api/safeStorage'; import { clearElectronStore } from './api/electronStore'; import { openDiskCache, deleteDiskCache } from './api/cache'; import { - checkExistsAndCreateCollectionDir, + checkExistsAndCreateDir, checkExistsAndRename, saveStreamToDisk, saveFileToDisk, @@ -42,6 +42,7 @@ import { openLogDirectory, getSentryUserID, getAppVersion, + openDirectory, } from './api/common'; import { fixHotReloadNext12 } from './utils/preload'; import { isFolder, getDirFiles } from './api/fs'; @@ -61,7 +62,7 @@ const windowObject: any = window; windowObject['ElectronAPIs'] = { exists, - checkExistsAndCreateCollectionDir, + checkExistsAndCreateDir, checkExistsAndRename, saveStreamToDisk, saveFileToDisk, @@ -103,4 +104,5 @@ windowObject['ElectronAPIs'] = { generateImageThumbnail, logRendererProcessMemoryUsage, registerForegroundEventListener, + openDirectory, }; diff --git a/src/utils/ipcComms.ts b/src/utils/ipcComms.ts index a0eab178a..2e9b4425a 100644 --- a/src/utils/ipcComms.ts +++ b/src/utils/ipcComms.ts @@ -113,6 +113,10 @@ export default function setupIpcComs( shell.openPath(app.getPath('logs')); }); + ipcMain.handle('open-dir', (_, dirPath) => { + shell.openPath(dirPath); + }); + ipcMain.on('update-and-restart', () => { updateAndRestart(); }); diff --git a/ui b/ui index f31d94e2c..6ec29b9af 160000 --- a/ui +++ b/ui @@ -1 +1 @@ -Subproject commit f31d94e2cb98fad8a8d15f03185ea1c4b60d5cf4 +Subproject commit 6ec29b9affc9e7630e098c16b15c98994afff6aa