From 3314713746df973b3205dd7a63cb918aa21b3432 Mon Sep 17 00:00:00 2001 From: Luiz Bezerra Date: Tue, 15 Oct 2024 09:49:24 +0100 Subject: [PATCH] changes to test new code Signed-off-by: Luiz Bezerra --- packages/suite-desktop/src/main/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/suite-desktop/src/main/index.ts b/packages/suite-desktop/src/main/index.ts index 8a63d4158e..f2dfba174d 100644 --- a/packages/suite-desktop/src/main/index.ts +++ b/packages/suite-desktop/src/main/index.ts @@ -8,6 +8,7 @@ import { app, BrowserWindow, ipcMain, Menu, nativeTheme, session } from "electron"; import fs from "fs"; import i18n from "i18next"; +import path from "path"; import Logger from "@lichtblick/log"; import { AppSetting } from "@lichtblick/suite-base/src/AppSetting"; @@ -138,7 +139,10 @@ export async function main(): Promise { // files our app should open - either from user double-click on a supported fileAssociation // or command line arguments. - const filesToOpen: string[] = process.argv.slice(1).filter(isFileToOpen); + const filesToOpen: string[] = process.argv + .slice(1) + .map((filePath) => path.resolve(filePath)) // Convert to absolute path, linux has some problems to resolve relative paths + .filter(isFileToOpen); // indicates the preloader has setup the file input used to inject which files to open let preloaderFileInputIsReady = false; @@ -172,9 +176,9 @@ export async function main(): Promise { preloaderFileInputIsReady = true; }); - ipcMain.handle("setRepresentedFilename", (ev, path: string | undefined) => { + ipcMain.handle("setRepresentedFilename", (ev, filePath: string | undefined) => { const browserWindow = BrowserWindow.fromId(ev.sender.id); - browserWindow?.setRepresentedFilename(path ?? ""); + browserWindow?.setRepresentedFilename(filePath ?? ""); }); const openUrls: string[] = [];