From: abias Date: Sun, 21 May 2023 16:40:22 +0000 (-0400) Subject: Allow user to submit rate limit changes X-Git-Url: http://these/git/%22%7Burl%7D/static/%7Bpost.url%7D?a=commitdiff_plain;h=cf58a0c4515f4c8ba772c00ca02a9f928fe749fc;p=lemmy-ui.git Allow user to submit rate limit changes --- diff --git a/src/shared/components/common/tabs.tsx b/src/shared/components/common/tabs.tsx index 36e1a01..61ed396 100644 --- a/src/shared/components/common/tabs.tsx +++ b/src/shared/components/common/tabs.tsx @@ -35,6 +35,7 @@ export default class Tabs extends Component { {this.props.tabs.map(({ key, label }) => (
  • + + + ); } + + componentDidUpdate({ localSiteRateLimit }: RateLimitFormProps) { + if ( + this.state.loading && + Object.entries(localSiteRateLimit).some( + ([key, val]) => this.state.form[key] !== val + ) + ) { + this.setState({ loading: false }); + } + } }