Skip to content
This repository was archived by the owner on Oct 11, 2022. It is now read-only.
Merged

2.1.5 #2562

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Spectrum",
"version": "2.1.3",
"version": "2.1.5",
"private": true,
"devDependencies": {
"babel-cli": "^6.24.1",
Expand Down
4 changes: 2 additions & 2 deletions shared/graphql/mutations/community/disableBrandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type DisableBrandedLoginType = {
slug: string,
brandedLogin: {
isEnabled: boolean,
customMessage: ?string,
message: ?string,
},
},
},
Expand All @@ -22,7 +22,7 @@ export const disableBrandedLoginMutation = gql`
slug
brandedLogin {
isEnabled
customMessage
message
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions shared/graphql/mutations/community/enableBrandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export type EnableBrandedLoginType = {
slug: string,
brandedLogin: {
isEnabled: boolean,
customMessage: ?string,
message: ?string,
},
},
},
Expand All @@ -22,7 +22,7 @@ export const enableBrandedLoginMutation = gql`
slug
brandedLogin {
isEnabled
customMessage
message
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/communityLogin/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const Subtitle = styled.h2`
margin-bottom: 16px;
padding: 0 32px;
text-align: center;
white-space: pre;
white-space: pre-wrap;

b {
font-weight: 700;
Expand Down
11 changes: 9 additions & 2 deletions src/views/communitySettings/components/brandedLogin.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ type Props = {
type State = {
messageValue: ?string,
messageLengthError: boolean,
isLoading: boolean,
};

class BrandedLogin extends React.Component<Props, State> {
state = {
messageValue: null,
messageLengthError: false,
isLoading: false,
};

componentDidUpdate(prevProps) {
Expand Down Expand Up @@ -69,17 +71,21 @@ class BrandedLogin extends React.Component<Props, State> {
});
}

this.setState({
isLoading: true,
});

return this.props
.saveBrandedLoginSettings({
message: messageValue,
id: this.props.data.community.id,
})
.then(() => {
this.setState({ messageLengthError: false });
this.setState({ messageLengthError: false, isLoading: false });
return this.props.dispatch(addToastWithTimeout('success', 'Saved!'));
})
.catch(err => {
this.setState({ messageLengthError: false });
this.setState({ messageLengthError: false, isLoading: false });
return this.props.dispatch(addToastWithTimeout('error', err));
});
};
Expand Down Expand Up @@ -127,6 +133,7 @@ class BrandedLogin extends React.Component<Props, State> {
onSubmit={this.saveCustomMessage}
onClick={this.saveCustomMessage}
disabled={messageLengthError}
loading={this.state.isLoading}
>
Save
</Button>
Expand Down