Merge pull request #1366 from sunaurus/main

Don't hide "show NSFW" checkbox on instances that have NSFW disabled
This commit is contained in:
SleeplessOne1917 2023-06-18 13:45:17 +00:00 committed by GitHub
commit 93b05d728a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 35 deletions

View file

@ -298,27 +298,22 @@ export class Signup extends Component<any, State> {
</>
)}
{this.renderCaptcha()}
{siteView.local_site.enable_nsfw && (
<div className="form-group row">
<div className="col-sm-10">
<div className="form-check">
<input
className="form-check-input"
id="register-show-nsfw"
type="checkbox"
checked={this.state.form.show_nsfw}
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
/>
<label
className="form-check-label"
htmlFor="register-show-nsfw"
>
{i18n.t("show_nsfw")}
</label>
</div>
<div className="form-group row">
<div className="col-sm-10">
<div className="form-check">
<input
className="form-check-input"
id="register-show-nsfw"
type="checkbox"
checked={this.state.form.show_nsfw}
onChange={linkEvent(this, this.handleRegisterShowNsfwChange)}
/>
<label className="form-check-label" htmlFor="register-show-nsfw">
{i18n.t("show_nsfw")}
</label>
</div>
</div>
)}
</div>
<input
tabIndex={-1}
autoComplete="false"

View file

@ -21,7 +21,6 @@ import {
debounce,
elementUrl,
emDash,
enableNsfw,
fetchCommunities,
fetchThemeList,
fetchUsers,
@ -642,22 +641,20 @@ export class Settings extends Component<any, SettingsState> {
/>
</div>
</form>
{enableNsfw(this.state.siteRes) && (
<div className="form-group">
<div className="form-check">
<input
className="form-check-input"
id="user-show-nsfw"
type="checkbox"
checked={this.state.saveUserSettingsForm.show_nsfw}
onChange={linkEvent(this, this.handleShowNsfwChange)}
/>
<label className="form-check-label" htmlFor="user-show-nsfw">
{i18n.t("show_nsfw")}
</label>
</div>
<div className="form-group">
<div className="form-check">
<input
className="form-check-input"
id="user-show-nsfw"
type="checkbox"
checked={this.state.saveUserSettingsForm.show_nsfw}
onChange={linkEvent(this, this.handleShowNsfwChange)}
/>
<label className="form-check-label" htmlFor="user-show-nsfw">
{i18n.t("show_nsfw")}
</label>
</div>
)}
</div>
<div className="form-group">
<div className="form-check">
<input