mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-19 14:08:31 +00:00
Replace electron-is-dev with app.isPackaged.
This unfortunately uses remote, but that’s what electron-is-dev was doing anyway. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import {app, dialog, session} from 'electron';
|
||||
import util from 'util';
|
||||
|
||||
import isDev from 'electron-is-dev';
|
||||
import log from 'electron-log';
|
||||
import {UpdateDownloadedEvent, UpdateInfo, autoUpdater} from 'electron-updater';
|
||||
|
||||
@@ -14,7 +13,7 @@ const sleep = util.promisify(setTimeout);
|
||||
|
||||
export async function appUpdater(updateFromMenu = false): Promise<void> {
|
||||
// Don't initiate auto-updates in development
|
||||
if (isDev) {
|
||||
if (!app.isPackaged) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import {app} from 'electron';
|
||||
|
||||
import AutoLaunch from 'auto-launch';
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
import * as ConfigUtil from '../renderer/js/utils/config-util';
|
||||
|
||||
export const setAutoLaunch = async (AutoLaunchValue: boolean): Promise<void> => {
|
||||
// Don't run this in development
|
||||
if (isDev) {
|
||||
if (!app.isPackaged) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {ipcRenderer} from 'electron';
|
||||
import {ipcRenderer, remote} from 'electron';
|
||||
import {EventEmitter} from 'events';
|
||||
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
import {ClipboardDecrypterImpl} from './clipboard-decrypter';
|
||||
import {NotificationData, newNotification} from './notification';
|
||||
|
||||
@@ -67,7 +65,7 @@ bridgeEvents.on('realm_icon_url', (iconURL: unknown) => {
|
||||
|
||||
// Set user as active and update the time of last activity
|
||||
ipcRenderer.on('set-active', () => {
|
||||
if (isDev) {
|
||||
if (!remote.app.isPackaged) {
|
||||
console.log('active');
|
||||
}
|
||||
|
||||
@@ -77,7 +75,7 @@ ipcRenderer.on('set-active', () => {
|
||||
|
||||
// Set user as idle and time of last activity is left unchanged
|
||||
ipcRenderer.on('set-idle', () => {
|
||||
if (isDev) {
|
||||
if (!remote.app.isPackaged) {
|
||||
console.log('idle');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {ipcRenderer, remote, clipboard} from 'electron';
|
||||
import path from 'path';
|
||||
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
import * as Messages from '../../resources/messages';
|
||||
|
||||
import FunctionalTab from './components/functional-tab';
|
||||
@@ -1060,7 +1058,7 @@ class ServerManagerView {
|
||||
window.addEventListener('load', async () => {
|
||||
// Only start electron-connect (auto reload on change) when its ran
|
||||
// from `npm run dev` or `gulp dev` and not from `npm start`
|
||||
if (isDev && remote.getGlobal('process').argv.includes('--electron-connect')) {
|
||||
if (!remote.app.isPackaged && remote.getGlobal('process').argv.includes('--electron-connect')) {
|
||||
// eslint-disable-next-line node/no-unsupported-features/es-syntax
|
||||
(await import('electron-connect')).client.create();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ import electron from 'electron';
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
import {initSetUp} from './default-util';
|
||||
import {sentryInit, captureException} from './sentry-util';
|
||||
|
||||
@@ -99,7 +97,7 @@ export default class Logger {
|
||||
args.unshift(type.toUpperCase() + ' |');
|
||||
// Fall through
|
||||
|
||||
case isDev || logInDevMode:
|
||||
case !app.isPackaged || logInDevMode:
|
||||
nodeConsole[type](...args);
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import electron from 'electron';
|
||||
|
||||
import {init} from '@sentry/electron';
|
||||
import isDev from 'electron-is-dev';
|
||||
|
||||
const {app} = process.type === 'renderer' ? electron.remote : electron;
|
||||
|
||||
export const sentryInit = (): void => {
|
||||
if (!isDev) {
|
||||
if (app.isPackaged) {
|
||||
init({
|
||||
dsn: 'https://628dc2f2864243a08ead72e63f94c7b1@sentry.io/204668',
|
||||
// We should ignore this error since it's harmless and we know the reason behind this
|
||||
|
||||
5
package-lock.json
generated
5
package-lock.json
generated
@@ -3450,11 +3450,6 @@
|
||||
"ws": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"electron-is-dev": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.2.0.tgz",
|
||||
"integrity": "sha512-R1oD5gMBPS7PVU8gJwH6CtT0e6VSoD0+SzSnYpNm+dBkcijgA+K7VAMHDfnRq/lkKPZArpzplTW6jfiMYosdzw=="
|
||||
},
|
||||
"electron-log": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmjs.org/electron-log/-/electron-log-4.3.1.tgz",
|
||||
|
||||
@@ -155,7 +155,6 @@
|
||||
"adm-zip": "^0.5.2",
|
||||
"auto-launch": "^5.0.5",
|
||||
"backoff": "^2.5.0",
|
||||
"electron-is-dev": "^1.2.0",
|
||||
"electron-log": "^4.3.1",
|
||||
"electron-updater": "^4.3.5",
|
||||
"electron-window-state": "^5.0.3",
|
||||
|
||||
Reference in New Issue
Block a user