{"size": 1461, "ext": "js", "max_stars_repo_path": "modules/discord_desktop_core/core/app/discord_native/renderer/crashReporter.js", "max_stars_repo_name": "S8msGITcode/Lightcord", "max_stars_repo_stars_event_min_datetime": "2021-02-28T20:10:45.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-28T20:10:45.000Z", "max_issues_repo_path": "modules/discord_desktop_core/core/app/discord_native/renderer/crashReporter.js", "max_issues_repo_name": "S8msGITcode/Lightcord", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "modules/discord_desktop_core/core/app/discord_native/renderer/crashReporter.js", "max_forks_repo_name": "S8msGITcode/Lightcord", "max_forks_repo_forks_event_min_datetime": "2021-10-30T20:20:37.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-30T20:20:37.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 38.4473684211, "max_line_length": 458, "alphanum_fraction": 0.7091033539}
'use strict';

let updateCrashReporter = (() => {
  var _ref = _asyncToGenerator(function* (additional_metadata) {
    const result = yield electron.ipcRenderer.invoke(CRASH_REPORTER_UPDATE_METADATA, additional_metadata);
    // Calling crashReporter.start from a renderer process was deprecated in Electron 9.
    if (getElectronMajorVersion() < 9) {
      //electron.crashReporter.start(result.args);
    }
    metadata = result.metadata || {};

    reconcileCrashReporterMetadata(electron.crashReporter, metadata);
  });

  return function updateCrashReporter(_x) {
    return _ref.apply(this, arguments);
  };
})();

function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }

const electron = require('electron');
const { getElectronMajorVersion, reconcileCrashReporterMetadata } = require('../common/utility');

const { CRASH_REPORTER_UPDATE_METADATA } = require('../common/constants').IPCEvents;

let metadata = {};

updateCrashReporter(metadata);

function getMetadata() {
  return metadata;
}

module.exports = {
  updateCrashReporter,
  getMetadata
};