revert stack conditional behavior, lint

This commit is contained in:
Tropical 2022-08-06 03:15:37 -04:00
parent e886e86747
commit eda0175ed7
2 changed files with 23 additions and 6 deletions

20
renderer/.pnpm-debug.log Normal file
View File

@ -0,0 +1,20 @@
{
"0 debug pnpm:scope": {
"selected": 1
},
"1 error pnpm": {
"errno": 1,
"code": "ELIFECYCLE",
"pkgid": "betterdiscord-renderer@",
"stage": "lint-js",
"script": "eslint --ext .jsx,.js src/",
"pkgname": "betterdiscord-renderer",
"err": {
"name": "pnpm",
"message": "betterdiscord-renderer@ lint-js: `eslint --ext .jsx,.js src/`\nExit status 1",
"code": "ELIFECYCLE",
"stack": "pnpm: betterdiscord-renderer@ lint-js: `eslint --ext .jsx,.js src/`\nExit status 1\n at EventEmitter.<anonymous> (C:\\Users\\Tropical\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:108610:20)\n at EventEmitter.emit (node:events:527:28)\n at ChildProcess.<anonymous> (C:\\Users\\Tropical\\AppData\\Roaming\\npm\\node_modules\\pnpm\\dist\\pnpm.cjs:95176:18)\n at ChildProcess.emit (node:events:527:28)\n at maybeClose (node:internal/child_process:1092:16)\n at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)"
}
},
"2 warn pnpm:global": " Local package.json exists, but node_modules missing, did you mean to install?"
}

View File

@ -10,7 +10,7 @@ const joinClassNames = (...classNames) => classNames.filter(e => e).join(" ");
class AddonError extends React.Component {
renderErrorBody(err) {
const stack = err.error && err.stack;
const stack = err?.error?.stack ?? err.stack;
if (!stack) return null;
return <div className="bd-addon-error-body">
@ -22,12 +22,9 @@ class AddonError extends React.Component {
}
render() {
const { err } = this.props;
const {err} = this.props;
return <details
key={`${err.type}-${this.props.index}`}
className="bd-addon-error"
>
return <details key={`${err.type}-${this.props.index}`} className="bd-addon-error">
<summary className="bd-addon-error-header">
<div className="bd-addon-error-icon">
{err.type == "plugin" ? <Extension /> : <ThemeIcon />}