mirror of https://gitee.com/answerdev/answer.git
refactor: Cancels the delayed handling of jump actions.
This commit is contained in:
parent
fa54cbc0d1
commit
d2924fab4f
|
@ -93,8 +93,8 @@ const Index: React.FC = () => {
|
|||
}
|
||||
|
||||
login(params)
|
||||
.then((res) => {
|
||||
passwordCaptcha.close();
|
||||
.then(async (res) => {
|
||||
await passwordCaptcha.close();
|
||||
updateUser(res);
|
||||
const userStat = guard.deriveLoginState();
|
||||
if (userStat.isNotActivated) {
|
||||
|
|
|
@ -94,10 +94,6 @@ export interface NavigateConfig {
|
|||
}
|
||||
const navigate = (to: string | number, config: NavigateConfig = {}) => {
|
||||
let { handler = 'href' } = config;
|
||||
/**
|
||||
* Note: Synchronised navigation can result in asynchronous actions such as page animations and state modifications not being completed.
|
||||
*/
|
||||
setTimeout(() => {
|
||||
if (to && typeof to === 'string') {
|
||||
if (equalToCurrentHref(to)) {
|
||||
return;
|
||||
|
@ -125,11 +121,9 @@ const navigate = (to: string | number, config: NavigateConfig = {}) => {
|
|||
handler(to, config.options);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof to === 'number' && typeof handler === 'function') {
|
||||
handler(to);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue