Merge commit '1ee457f2d37c2b77a7fbce246a7c72ac9f9d3056' into glitch-soc/merge-upstream
This commit is contained in:
commit
291f141a02
15 files changed
+200
-34
No files matched your search
@@ -166,6 +166,38 @@ on('change', '#domain_block_severity', ({ target }) => {
|
||||
if (target instanceof HTMLSelectElement) onDomainBlockSeverityChange(target);
|
||||
});
|
||||
|
||||
const onChangeInviteUsersPermission = (target: HTMLInputElement) => {
|
||||
const inviteBypassApprovalCheckbox = document.querySelector<HTMLInputElement>(
|
||||
'input#user_role_permissions_as_keys_invite_bypass_approval',
|
||||
);
|
||||
|
||||
if (inviteBypassApprovalCheckbox) {
|
||||
inviteBypassApprovalCheckbox.disabled = !target.checked;
|
||||
|
||||
if (target.checked) {
|
||||
inviteBypassApprovalCheckbox.parentElement?.classList.remove('disabled');
|
||||
inviteBypassApprovalCheckbox.parentElement?.parentElement?.classList.remove(
|
||||
'disabled',
|
||||
);
|
||||
} else {
|
||||
inviteBypassApprovalCheckbox.parentElement?.classList.add('disabled');
|
||||
inviteBypassApprovalCheckbox.parentElement?.parentElement?.classList.add(
|
||||
'disabled',
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
on(
|
||||
'change',
|
||||
'input#user_role_permissions_as_keys_invite_users',
|
||||
({ target }) => {
|
||||
if (target instanceof HTMLInputElement) {
|
||||
onChangeInviteUsersPermission(target);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function onEnableBootstrapTimelineAccountsChange(target: HTMLInputElement) {
|
||||
const bootstrapTimelineAccountsField =
|
||||
document.querySelector<HTMLInputElement>(
|
||||
@@ -291,6 +323,13 @@ ready(() => {
|
||||
);
|
||||
if (registrationMode) onChangeRegistrationMode(registrationMode);
|
||||
|
||||
const inviteUsersPermissionChecbkox =
|
||||
document.querySelector<HTMLInputElement>(
|
||||
'input#user_role_permissions_as_keys_invite_users',
|
||||
);
|
||||
if (inviteUsersPermissionChecbkox)
|
||||
onChangeInviteUsersPermission(inviteUsersPermissionChecbkox);
|
||||
|
||||
const checkAllElement = document.querySelector<HTMLInputElement>(
|
||||
'#batch_checkbox_all',
|
||||
);
|
||||
|
||||
@@ -158,24 +158,11 @@ class Status extends ImmutablePureComponent {
|
||||
newRepliesIds: [],
|
||||
};
|
||||
|
||||
UNSAFE_componentWillMount () {
|
||||
componentDidMount() {
|
||||
this.props.dispatch(fetchStatus(this.props.params.statusId, { forceFetch: true }));
|
||||
}
|
||||
|
||||
componentDidMount () {
|
||||
attachFullscreenListener(this.onFullScreenChange);
|
||||
}
|
||||
|
||||
UNSAFE_componentWillReceiveProps (nextProps) {
|
||||
if (nextProps.params.statusId !== this.props.params.statusId && nextProps.params.statusId) {
|
||||
this.props.dispatch(fetchStatus(nextProps.params.statusId, { forceFetch: true }));
|
||||
}
|
||||
|
||||
if (nextProps.status && nextProps.status.get('id') !== this.state.loadedStatusId) {
|
||||
this.setState({ showMedia: defaultMediaVisibility(nextProps.status), loadedStatusId: nextProps.status.get('id') });
|
||||
}
|
||||
}
|
||||
|
||||
handleToggleMediaVisibility = () => {
|
||||
this.setState({ showMedia: !this.state.showMedia });
|
||||
};
|
||||
@@ -493,8 +480,8 @@ class Status extends ImmutablePureComponent {
|
||||
this.statusNode = c;
|
||||
};
|
||||
|
||||
componentDidUpdate (prevProps) {
|
||||
const { status, descendantsIds } = this.props;
|
||||
componentDidUpdate(prevProps) {
|
||||
const { status, descendantsIds, params } = this.props;
|
||||
|
||||
const isSameStatus = status && (prevProps.status?.get('id') === status.get('id'));
|
||||
|
||||
@@ -506,6 +493,14 @@ class Status extends ImmutablePureComponent {
|
||||
this.setState({newRepliesIds});
|
||||
}
|
||||
}
|
||||
|
||||
if (params.statusId && prevProps.params.statusId !== params.statusId) {
|
||||
this.props.dispatch(fetchStatus(params.statusId, { forceFetch: true }));
|
||||
}
|
||||
|
||||
if (status && status.get('id') !== this.state.loadedStatusId) {
|
||||
this.setState({ showMedia: defaultMediaVisibility(this.props.status), loadedStatusId: status.get('id') });
|
||||
}
|
||||
}
|
||||
|
||||
componentWillUnmount () {
|
||||
|
||||
@@ -506,6 +506,10 @@ code {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.checkbox.disabled {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
label.checkbox {
|
||||
|
||||
Reference in new issue
Block a user