mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +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, {
|
app.DrawerController.open("Register", UserRegister, {
|
||||||
allowMultiples: false,
|
defaultLocked: options.defaultLocked ?? false,
|
||||||
panel: true,
|
componentProps: {
|
||||||
|
sessionController: this.sessionController,
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
bodyStyle: {
|
||||||
|
height: "100%",
|
||||||
|
}
|
||||||
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// Opens the notification window and sets up the UI for the notification to be displayed
|
// 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 = {
|
const componentProps = {
|
||||||
...this.options.componentProps,
|
...this.options.componentProps,
|
||||||
|
locked: this.state.locked,
|
||||||
lock: this.lock,
|
lock: this.lock,
|
||||||
unlock: this.unlock,
|
unlock: this.unlock,
|
||||||
events: this.events,
|
events: this.events,
|
||||||
|
@ -79,11 +79,17 @@ export default class Login extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClickRegister = () => {
|
onClickRegister = () => {
|
||||||
|
if (this.props.locked) {
|
||||||
|
this.props.unlock()
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof this.props.close === "function") {
|
if (typeof this.props.close === "function") {
|
||||||
this.props.close()
|
this.props.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
app.eventBus.emit("app.createRegister")
|
app.controls.openRegisterForm({
|
||||||
|
defaultLocked: this.props.locked
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleLoading = (to) => {
|
toggleLoading = (to) => {
|
||||||
|
@ -349,9 +349,19 @@ export default (props) => {
|
|||||||
antd.message.success("User registered successfully.")
|
antd.message.success("User registered successfully.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.locked) {
|
||||||
|
props.unlock()
|
||||||
|
}
|
||||||
|
|
||||||
if (typeof props.close === "function") {
|
if (typeof props.close === "function") {
|
||||||
props.close()
|
props.close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (app.isMobile) {
|
||||||
|
app.controls.openLoginForm({
|
||||||
|
defaultLocked: props.locked,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return <StepsForm
|
return <StepsForm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user