Skip to content

Commit

Permalink
changes to test new code
Browse files Browse the repository at this point in the history
Signed-off-by: Luiz Bezerra <[email protected]>
  • Loading branch information
luluiz committed Oct 15, 2024
1 parent c2b9812 commit 3314713
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/suite-desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -138,7 +139,10 @@ export async function main(): Promise<void> {

// 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;
Expand Down Expand Up @@ -172,9 +176,9 @@ export async function main(): Promise<void> {
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[] = [];
Expand Down

0 comments on commit 3314713

Please sign in to comment.