ui/index: fix getPlatformInfo w/ polyfill (#14171)

feature/default_network_editable
Ariella Vu 3 years ago committed by GitHub
parent 4c009d5ae5
commit 69cba6d9fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      ui/index.js

@ -3,6 +3,8 @@ import log from 'loglevel';
import { clone } from 'lodash';
import React from 'react';
import { render } from 'react-dom';
import browser from 'webextension-polyfill';
import { getEnvironmentType } from '../app/scripts/lib/util';
import { ALERT_TYPES } from '../shared/constants/alerts';
import { SENTRY_STATE } from '../app/scripts/lib/setupSentry';
@ -205,15 +207,16 @@ function setupDebuggingHelpers(store) {
window.logStateString = async function (cb) {
const state = await window.getCleanAppState();
global.platform.getPlatformInfo((err, platform) => {
if (err) {
browser.runtime
.getPlatformInfo()
.then((platform) => {
state.platform = platform;
const stateString = JSON.stringify(state, null, 2);
cb(null, stateString);
})
.catch((err) => {
cb(err);
return;
}
state.platform = platform;
const stateString = JSON.stringify(state, null, 2);
cb(null, stateString);
});
});
};
window.logState = function (toClipboard) {

Loading…
Cancel
Save