Skip to content

Commit

Permalink
feat: Send a new param --provider to the Explorer
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Dec 5, 2024
1 parent a05b924 commit 9ac9e5f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/main/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import JSZip from 'jszip';
import { extract, list } from 'tar';
import semver from 'semver';

const DEFAULT_PROVIDER = 'dcl';

export function getAppVersion(): string {
return app.getVersion();
}
Expand Down Expand Up @@ -165,3 +167,7 @@ export function compareVersions(version1: string, version2: string) {
const result = semver.compare(version1, version2);
return result > 0;
}

export function getProvider() {
return import.meta.env.VITE_PROVIDER || DEFAULT_PROVIDER;
}
4 changes: 3 additions & 1 deletion packages/main/src/modules/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
getBucketURL,
RELEASE_PREFIX,
} from '#shared';
import { getAppBasePath, decompressFile, getOSName, isAppUpdated, PLATFORM, getAppVersion } from '../helpers';
import { getAppBasePath, decompressFile, getOSName, isAppUpdated, PLATFORM, getAppVersion, getProvider } from '../helpers';
import { getUserId } from './config';

const EXPLORER_PATH = join(getAppBasePath(), 'Explorer');
Expand Down Expand Up @@ -219,6 +219,8 @@ export async function launchExplorer(event: Electron.IpcMainInvokeEvent, version
analytics.getAnonymousId(),
'--session_id',
analytics.getSessionId(),
'--provider',
getProvider(),
].filter(arg => !!arg);
log.info('[Main Window][IPC][LaunchExplorer] Opening the Explorer', explorerParams);
spawn(explorerBinPath, explorerParams, { detached: true, stdio: 'ignore' })
Expand Down

0 comments on commit 9ac9e5f

Please sign in to comment.