Skip to content

Commit

Permalink
don't double parse
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko committed Sep 15, 2023
1 parent 54ccfe7 commit 4c80969
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions resources/js/beatmap-discussions/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export default class Main extends React.Component<Props> {
constructor(props: Props) {
super(props);

if (this.props.container.dataset.beatmapset != null) {
JSON.parse(this.props.container.dataset.beatmapset);
}

// using DiscussionsState['beatmapset'] as type cast to force errors if it doesn't match with props since the beatmapset is from discussionsState.
const existingBeatmapset = parseJson<DiscussionsState['beatmapset']>(props.container.dataset.beatmapset);
this.store = new BeatmapsetDiscussionsStore(existingBeatmapset ?? this.props.initial.beatmapset);
Expand Down

0 comments on commit 4c80969

Please sign in to comment.