Skip to content

Commit a914e88

Browse files
committed
minor stuff, error handling + cleanup
1 parent 16dd540 commit a914e88

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

src/controls/DynDiv.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import { extend } from '../util/ExtensionProvider';
55
import * as React from 'react';
66
import { IExtensibleProps } from '../types/IExtensionProvider';
77

8+
import ErrorBoundary from '../controls/ErrorBoundary';
9+
810
interface IDynDivDefinition {
911
component: React.ComponentClass<any>;
1012
options: IDynDivOptions;
@@ -41,9 +43,11 @@ class DynDiv extends React.Component<IProps, {}> {
4143
}
4244

4345
return (
44-
<div id={group} className={classes.join(' ')}>
45-
{visible.map((comp, idx) => this.renderComponent(comp, idx))}
46-
</div>
46+
<ErrorBoundary key={`dynamic-div-${group}`}>
47+
<div id={group} className={classes.join(' ')}>
48+
{visible.map((comp, idx) => this.renderComponent(comp, idx))}
49+
</div>
50+
</ErrorBoundary>
4751
);
4852
}
4953

src/extensions/mod_management/util/deploy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { startActivity, stopActivity } from '../../../actions/session';
22
import { IDeployedFile, IDeploymentMethod, IExtensionApi } from '../../../types/IExtensionContext';
33
import { IGame } from '../../../types/IGame';
4-
import { INotification } from '../../../types/INotification';
54
import { IProfile } from '../../../types/IState';
65
import { ProcessCanceled, TemporaryError } from '../../../util/CustomErrors';
76
import { log } from '../../../util/log';
@@ -10,7 +9,7 @@ import { getSafe } from '../../../util/storeHelper';
109
import { truthy } from '../../../util/util';
1110
import { IModType } from '../../gamemode_management/types/IModType';
1211
import { getGame } from '../../gamemode_management/util/getGame';
13-
import { installPath, installPathForGame } from '../selectors';
12+
import { installPathForGame } from '../selectors';
1413
import { IMod } from '../types/IMod';
1514
import { fallbackPurgeType, getManifest, loadActivation, saveActivation, withActivationLock } from './activationStore';
1615
import { getActivator, getCurrentActivator } from './deploymentMethods';

src/extensions/mod_management/views/ExternalChangeDialog.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class ExternalChangeDialog extends ComponentEx<IProps, IComponentState> {
231231
return (
232232
<div style={{ flex: '1 1 0', display: 'flex', flexDirection: 'column' }}>
233233
{text}
234-
<p>{actions.map(action => (
234+
<div>{actions.map(action => (
235235
<div key={action.key}>
236236
<a
237237
key={action.key}
@@ -241,7 +241,7 @@ class ExternalChangeDialog extends ComponentEx<IProps, IComponentState> {
241241
</a><span className='link-action-seperator'>&nbsp; | &nbsp;</span>
242242
</div>
243243
))
244-
}</p>
244+
}</div>
245245
<div style={{ overflowY: 'auto', flex: '1 1 0' }}>
246246
<Table
247247
tableId={`external-change-${type}`}

src/extensions/mod_management/views/ModList.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1076,7 +1076,13 @@ class ModList extends ComponentEx<IProps, IComponentState> {
10761076
}
10771077

10781078
private updateModGrouping(modsWithState) {
1079-
const modList = Object.keys(modsWithState).map(key => modsWithState[key]);
1079+
const modList = Object.keys(modsWithState).reduce((accum, key) => {
1080+
const mod = modsWithState[key];
1081+
if (mod) {
1082+
accum.push(mod);
1083+
}
1084+
return accum;
1085+
}, []);
10801086
const grouped = groupMods(modList, { groupBy: 'file', multipleEnabled: false });
10811087

10821088
const groupedMods = grouped.reduce((prev: { [id: string]: IModWithState[] }, value) => {

0 commit comments

Comments
 (0)