Skip to content

Commit

Permalink
port fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dageavtobusnick committed Dec 27, 2024
1 parent 358920d commit 04ad27f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tgui/packages/tgui/components/DmIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ export class DmIcon extends Component<Props, { iconRef: string }> {
};
}
async fetchRefMap() {
const response = await fetchRetry(resolveAsset('icon_ref_map.json'));
const data = await response.json();
refMap = data;
this.setState({ iconRef: data[this.props.icon] });
try {
const response = await fetchRetry(resolveAsset('icon_ref_map.json'));
const data = await response.json();
refMap = data;
this.setState({ iconRef: data[this.props.icon] || '' });
} catch (err) {
return;
}
}
componentDidMount() {
if (!refMap) {
Expand Down

0 comments on commit 04ad27f

Please sign in to comment.