Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"workspaces": [
"workspaces/*"
],
"productName": "Rocket.Chat",
"name": "rocketchat",
"description": "Official OSX, Windows, and Linux Desktop Clients for Rocket.Chat",
"version": "3.8.19",
Expand Down Expand Up @@ -137,4 +138,4 @@
"@fiahfy/icns-convert/sharp": "0.29.3",
"@fiahfy/ico-convert/sharp": "0.29.3"
}
}
}
22 changes: 20 additions & 2 deletions src/app/main/app.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,39 @@
import { app } from 'electron';
import rimraf from 'rimraf';

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore:next-line
// eslint-disable-next-line import/order
import electronBuilderJson from '../../../electron-builder.json';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore:next-line
// eslint-disable-next-line import/order
import packageJson from '../../../package.json';

import { dispatch, listen } from '../../store';
import { readSetting } from '../../store/readSetting';
import { SETTINGS_SET_HARDWARE_ACCELERATION_OPT_IN_CHANGED } from '../../ui/actions';
import { getRootWindow } from '../../ui/main/rootWindow';
import { APP_PATH_SET, APP_VERSION_SET } from '../actions';

export const packageJsonInformation = {
productName: packageJson.productName,
};

export const electronBuilderJsonInformation = {
appId: electronBuilderJson.appId,
protocol: electronBuilderJson.protocols.schemes[0],
};

export const relaunchApp = (...args: string[]): void => {
const command = process.argv.slice(1, app.isPackaged ? 1 : 2);
app.relaunch({ args: [...command, ...args] });
app.exit();
};

export const performElectronStartup = (): void => {
app.setAsDefaultProtocolClient('rocketchat');
app.setAppUserModelId('chat.rocket');
app.setAsDefaultProtocolClient(electronBuilderJsonInformation.protocol);
app.setAppUserModelId(electronBuilderJsonInformation.appId);

app.commandLine.appendSwitch('--autoplay-policy', 'no-user-gesture-required');
app.commandLine.appendSwitch(
Expand Down
3 changes: 2 additions & 1 deletion src/servers/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from 'path';
import { app } from 'electron';
import { satisfies, coerce } from 'semver';

import { packageJsonInformation } from '../app/main/app';
import { invoke } from '../ipc/main';
import { select, dispatch, listen } from '../store';
import { hasMeta } from '../store/fsa';
Expand Down Expand Up @@ -118,7 +119,7 @@ const loadAppServers = async (): Promise<Record<string, string>> => {
);

if (process.platform === 'darwin') {
const darwinFilePath = '/Library/Preferences/Rocket.Chat/servers.json';
const darwinFilePath = `/Library/Preferences/${packageJsonInformation.productName}/servers.json`;
if (fs.existsSync(darwinFilePath)) filePath = darwinFilePath;
}

Expand Down
5 changes: 4 additions & 1 deletion src/ui/components/AboutDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { useTranslation, Trans } from 'react-i18next';
import { useDispatch, useSelector } from 'react-redux';
import { Dispatch } from 'redux';

import { packageJsonInformation } from '../../../app/main/app';
import { RootAction } from '../../../store/actions';
import { RootState } from '../../../store/rootReducer';
import { UPDATES_CHECK_FOR_UPDATES_REQUESTED } from '../../../updates/actions';
Expand All @@ -22,7 +23,9 @@ import {
import { Dialog } from '../Dialog';
import { RocketChatLogo } from '../RocketChatLogo';

const copyright = `© 2016-${new Date().getFullYear()}, Rocket.Chat`;
const copyright = `© 2016-${new Date().getFullYear()}, ${
packageJsonInformation.productName
}`;

export const AboutDialog: FC = () => {
const appVersion = useSelector(({ appVersion }: RootState) => appVersion);
Expand Down