matrix-art

An image gallery for Matrix
git clone git://archive.git.mtrnord.blog/MTRNord/matrix-art.git
Log | Files | Refs | README | LICENSE

commit 509c559d403bf41542c9f51f0196fc5b303eec4e
parent 3b20dadd2d383536408552f220b361ede82dae70
Author: MTRNord <mtrnord1@gmail.com>
Date:   Sat, 29 Jan 2022 23:57:18 +0100

Prevent possible endless loop of updates

Diffstat:
Mcomponents/submit_page/main.tsx | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/components/submit_page/main.tsx b/components/submit_page/main.tsx @@ -428,9 +428,11 @@ class MainSubmissionForm extends PureComponent<Props, State> { if (this.state[title] && this.state[license] && this.state[description] && this.state[nsfw]) { validated = true; } - this.setState({ - [`${this.state.currentFileIndex}_valid`]: validated - } as State); + if (this.state[`${this.state.currentFileIndex}_valid`] !== validated) { + this.setState({ + [`${this.state.currentFileIndex}_valid`]: validated + } as State); + } } handleInputChange(event: { target: any; }) {