getAppVersion for UpdateIndicator

Summary:
VSCode got a new thing where it doesn't save my file because it waits for a formatter or some stuff indefinitely, which is really cool, because it means my diffs end up being incomplete.

So this should have been in D26223274 (642d89213d) but now it's here.

angry_cry

Reviewed By: nikoant

Differential Revision: D26228038

fbshipit-source-id: 98b84179dce4e8e8c71f9196ab78d534327ea301
This commit is contained in:
Pascal Hartig
2021-02-04 04:32:49 -08:00
committed by Facebook GitHub Bot
parent 2f03aca5eb
commit 661af25ff9

View File

@@ -13,12 +13,10 @@ import {reportPlatformFailures} from '../utils/metrics';
import React, {useEffect, useState} from 'react';
import fbConfig from '../fb-stubs/config';
import {useStore} from '../utils/useStore';
import {remote} from 'electron';
import {getAppVersion} from '../utils/info';
import {checkForUpdate} from '../fb-stubs/checkForUpdate';
import ReleaseChannel from '../ReleaseChannel';
const version = remote.app.getVersion();
export type VersionCheckResult =
| {
kind: 'update-available';
@@ -90,6 +88,7 @@ export default function UpdateIndicator() {
// trigger the update check, unless there is a launcher message already
useEffect(() => {
const version = getAppVersion();
if (launcherMsg && launcherMsg.message) {
if (launcherMsg.severity === 'error') {
notification.error({
@@ -108,7 +107,7 @@ export default function UpdateIndicator() {
duration: null,
});
}
} else if (isProduction()) {
} else if (version && isProduction()) {
reportPlatformFailures(
checkForUpdate(version).then((res) => {
if (res.kind === 'error') {