From 661af25ff9803eaf4ff1d8b62632dc1bb4484c59 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 4 Feb 2021 04:32:49 -0800 Subject: [PATCH] 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 (https://github.com/facebook/flipper/commit/642d89213dbd2813f792caca7da7b0c570a7df19) but now it's here. angry_cry Reviewed By: nikoant Differential Revision: D26228038 fbshipit-source-id: 98b84179dce4e8e8c71f9196ab78d534327ea301 --- desktop/app/src/chrome/UpdateIndicator.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/chrome/UpdateIndicator.tsx b/desktop/app/src/chrome/UpdateIndicator.tsx index 0ed9060b1..07e15611c 100644 --- a/desktop/app/src/chrome/UpdateIndicator.tsx +++ b/desktop/app/src/chrome/UpdateIndicator.tsx @@ -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') {