mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-22 12:21:13 +00:00
Fix allowed and blocked instances not being fetched for admin settings (#1627)
Co-authored-by: Dessalines <dessalines@users.noreply.github.com>
This commit is contained in:
parent
7cdbc42c5c
commit
34188ebd84
1 changed files with 16 additions and 0 deletions
|
@ -4,6 +4,7 @@ import {
|
|||
Component,
|
||||
InfernoKeyboardEvent,
|
||||
InfernoMouseEvent,
|
||||
InfernoNode,
|
||||
linkEvent,
|
||||
} from "inferno";
|
||||
import {
|
||||
|
@ -13,6 +14,7 @@ import {
|
|||
Instance,
|
||||
ListingType,
|
||||
} from "lemmy-js-client";
|
||||
import deepEqual from "lodash.isequal";
|
||||
import { I18NextService } from "../../services";
|
||||
import { Icon, Spinner } from "../common/icon";
|
||||
import { ImageUploadForm } from "../common/image-upload-form";
|
||||
|
@ -55,6 +57,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
|||
initSiteForm(): EditSite {
|
||||
const site = this.props.siteRes.site_view.site;
|
||||
const ls = this.props.siteRes.site_view.local_site;
|
||||
|
||||
return {
|
||||
name: site.name,
|
||||
sidebar: site.sidebar,
|
||||
|
@ -619,6 +622,19 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
|
|||
);
|
||||
}
|
||||
|
||||
componentDidUpdate(
|
||||
prevProps: Readonly<{ children?: InfernoNode } & SiteFormProps>
|
||||
) {
|
||||
if (
|
||||
!(
|
||||
deepEqual(prevProps.allowedInstances, this.props.allowedInstances) ||
|
||||
deepEqual(prevProps.blockedInstances, this.props.blockedInstances)
|
||||
)
|
||||
) {
|
||||
this.setState({ siteForm: this.initSiteForm() });
|
||||
}
|
||||
}
|
||||
|
||||
federatedInstanceSelect(key: InstanceKey) {
|
||||
const id = `create_site_${key}`;
|
||||
const value = this.state.instance_select[key];
|
||||
|
|
Loading…
Reference in a new issue