Fix version check in crash handler

This commit is contained in:
Fedor Indutny 2024-02-28 09:30:49 -08:00 committed by GitHub
parent abad547c32
commit c64aa86736
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@ import z from 'zod';
import type { LoggerType } from '../ts/types/Logging'; import type { LoggerType } from '../ts/types/Logging';
import * as Errors from '../ts/types/errors'; import * as Errors from '../ts/types/errors';
import { isAlpha } from '../ts/util/version'; import { isProduction } from '../ts/util/version';
import OS from '../ts/util/os/osMain'; import OS from '../ts/util/os/osMain';
const dumpSchema = z const dumpSchema = z
@ -68,7 +68,7 @@ export function setup(
showDebugLogWindow: () => Promise<void>, showDebugLogWindow: () => Promise<void>,
forceEnable = false forceEnable = false
): void { ): void {
const isEnabled = isAlpha(app.getVersion()) || forceEnable; const isEnabled = !isProduction(app.getVersion()) || forceEnable;
if (isEnabled) { if (isEnabled) {
getLogger().info(`crashReporter: ${forceEnable ? 'force ' : ''}enabled`); getLogger().info(`crashReporter: ${forceEnable ? 'force ' : ''}enabled`);