Remove server url awareness from LoginForm making it a cleaner component.
parent
9f5da61dfb
commit
e710e89200
|
@ -26,7 +26,7 @@ class LoginForm extends React.PureComponent {
|
|||
};
|
||||
|
||||
props: {
|
||||
onSubmit: (username: string, password: string, encryptionPassword: string, serviceApiUrl: string) => void;
|
||||
onSubmit: (username: string, password: string, encryptionPassword: string, serviceApiUrl?: string) => void;
|
||||
loading?: boolean;
|
||||
error?: Error;
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ class LoginForm extends React.PureComponent {
|
|||
|
||||
generateEncryption(e: any) {
|
||||
e.preventDefault();
|
||||
const server = this.state.showAdvanced ? this.state.server : C.serviceApiBase;
|
||||
const server = this.state.showAdvanced ? this.state.server : undefined;
|
||||
|
||||
const username = this.state.username;
|
||||
const password = this.state.password;
|
||||
|
|
|
@ -21,7 +21,8 @@ class Root extends React.PureComponent {
|
|||
this.onFormSubmit = this.onFormSubmit.bind(this);
|
||||
}
|
||||
|
||||
onFormSubmit(username: string, password: string, encryptionPassword: string, serviceApiUrl: string) {
|
||||
onFormSubmit(username: string, password: string, encryptionPassword: string, serviceApiUrl?: string) {
|
||||
serviceApiUrl = serviceApiUrl ? serviceApiUrl : C.serviceApiBase;
|
||||
store.dispatch(fetchCredentials(username, password, encryptionPassword, serviceApiUrl));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue