Fixed a small UI display bug when directly opening the permission editor for the client/client channel permissions
This commit is contained in:
parent
5767430f79
commit
35881be6d1
2 changed files with 13 additions and 11 deletions
|
@ -909,19 +909,22 @@ const ClientSelect = (props: { events: Registry<PermissionModalEvents>, tabTarge
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
props.events.reactUse("query_client_info", event => {
|
const resetInfoFields = (placeholder?: string) => {
|
||||||
if(event.client !== clientIdentifier)
|
|
||||||
return;
|
|
||||||
|
|
||||||
refNickname.current?.setValue(undefined);
|
refNickname.current?.setValue(undefined);
|
||||||
refUniqueIdentifier.current?.setValue(undefined);
|
refUniqueIdentifier.current?.setValue(undefined);
|
||||||
refDatabaseId.current?.setValue(undefined);
|
refDatabaseId.current?.setValue(undefined);
|
||||||
|
|
||||||
refInput.current?.setState({ disabled: true });
|
refNickname.current?.setState({ placeholder: placeholder });
|
||||||
refNickname.current?.setState({ placeholder: tr("loading...") });
|
refUniqueIdentifier.current?.setState({ placeholder: placeholder });
|
||||||
refUniqueIdentifier.current?.setState({ placeholder: tr("loading...") });
|
refDatabaseId.current?.setState({ placeholder: placeholder });
|
||||||
refDatabaseId.current?.setState({ placeholder: tr("loading...") });
|
};
|
||||||
|
|
||||||
|
props.events.reactUse("query_client_info", event => {
|
||||||
|
if(event.client !== clientIdentifier)
|
||||||
|
return;
|
||||||
|
|
||||||
|
refInput.current?.setState({ disabled: true });
|
||||||
|
resetInfoFields(tr("loading..."));
|
||||||
props.events.fire("action_set_permission_editor_subject", { mode: props.tabTarget, clientDatabaseId: 0 });
|
props.events.fire("action_set_permission_editor_subject", { mode: props.tabTarget, clientDatabaseId: 0 });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -963,9 +966,7 @@ const ClientSelect = (props: { events: Registry<PermissionModalEvents>, tabTarge
|
||||||
props.events.fire_async("query_client_info", { client: event.id });
|
props.events.fire_async("query_client_info", { client: event.id });
|
||||||
} else {
|
} else {
|
||||||
refInput.current?.setValue(undefined);
|
refInput.current?.setValue(undefined);
|
||||||
refNickname.current?.setState({ placeholder: undefined });
|
resetInfoFields(undefined);
|
||||||
refUniqueIdentifier.current?.setState({ placeholder: undefined });
|
|
||||||
refDatabaseId.current?.setState({ placeholder: undefined });
|
|
||||||
props.events.fire("action_set_permission_editor_subject", { mode: props.tabTarget, clientDatabaseId: 0 });
|
props.events.fire("action_set_permission_editor_subject", { mode: props.tabTarget, clientDatabaseId: 0 });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -200,6 +200,7 @@ export class FlatInputField extends React.Component<FlatInputFieldProperties, Fl
|
||||||
|
|
||||||
setValue(value: string | undefined) {
|
setValue(value: string | undefined) {
|
||||||
this.refInput.current.value = typeof value === "undefined" ? "" : value;
|
this.refInput.current.value = typeof value === "undefined" ? "" : value;
|
||||||
|
this.setState({ filled: !!value });
|
||||||
}
|
}
|
||||||
|
|
||||||
inputElement() : HTMLInputElement | undefined {
|
inputElement() : HTMLInputElement | undefined {
|
||||||
|
|
Loading…
Add table
Reference in a new issue