mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
fix login drawer logics
This commit is contained in:
parent
94f500aa8c
commit
f4ba64531a
@ -187,10 +187,17 @@ class ComtyApp extends React.Component {
|
||||
}
|
||||
})
|
||||
},
|
||||
openRegisterForm: async () => {
|
||||
openRegisterForm: async (options = {}) => {
|
||||
app.DrawerController.open("Register", UserRegister, {
|
||||
allowMultiples: false,
|
||||
panel: true,
|
||||
defaultLocked: options.defaultLocked ?? false,
|
||||
componentProps: {
|
||||
sessionController: this.sessionController,
|
||||
},
|
||||
props: {
|
||||
bodyStyle: {
|
||||
height: "100%",
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
// Opens the notification window and sets up the UI for the notification to be displayed
|
||||
|
@ -180,6 +180,7 @@ export class Drawer extends React.Component {
|
||||
}
|
||||
const componentProps = {
|
||||
...this.options.componentProps,
|
||||
locked: this.state.locked,
|
||||
lock: this.lock,
|
||||
unlock: this.unlock,
|
||||
events: this.events,
|
||||
|
@ -79,11 +79,17 @@ export default class Login extends React.Component {
|
||||
}
|
||||
|
||||
onClickRegister = () => {
|
||||
if (this.props.locked) {
|
||||
this.props.unlock()
|
||||
}
|
||||
|
||||
if (typeof this.props.close === "function") {
|
||||
this.props.close()
|
||||
}
|
||||
|
||||
app.eventBus.emit("app.createRegister")
|
||||
app.controls.openRegisterForm({
|
||||
defaultLocked: this.props.locked
|
||||
})
|
||||
}
|
||||
|
||||
toggleLoading = (to) => {
|
||||
|
@ -349,9 +349,19 @@ export default (props) => {
|
||||
antd.message.success("User registered successfully.")
|
||||
}
|
||||
|
||||
if (props.locked) {
|
||||
props.unlock()
|
||||
}
|
||||
|
||||
if (typeof props.close === "function") {
|
||||
props.close()
|
||||
}
|
||||
|
||||
if (app.isMobile) {
|
||||
app.controls.openLoginForm({
|
||||
defaultLocked: props.locked,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return <StepsForm
|
||||
|
Loading…
x
Reference in New Issue
Block a user