-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix: Node switchover information Added the node mode #8347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -337,6 +337,7 @@ const login = (formEl: FormInstance | undefined) => { | |
| menuStore.setMenuList([]); | ||
| tabsStore.removeAllTabs(); | ||
| globalStore.currentNode = 'local'; | ||
| globalStore.isOffline = false; | ||
| MsgSuccess(i18n.t('commons.msg.loginSuccess')); | ||
| router.push({ name: 'home' }); | ||
| document.onkeydown = null; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes in this code snippet aim to address specific functionalities related to user authentication and system state management. Here's the corrected and optimized version: const login = (formEl: FormInstance | undefined) => {
if (formEl) formEl?.resetFields();
menuStore.setMenuList([]);
tabsStore.removeAllTabs();
globalStore.currentNode = 'local';
// Check for network connection before setting isOffline to true for offline mode
if (!navigator.onLine && !globalStore.isMobileDevice) {
globalStore.isOffline = true;
}
MsgSuccess(i18n.t('commons.msg.loginSuccess'));
router.push({ name: 'home' });
document.body.removeEventListener?('keydown', onKeyDown);
};Key Changes:
These modifications help improve the robustness and usability of the authentication flow while preventing unexpected behavior during logouts. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The provided code snippet contains minor issues that can be addressed for better performance and clarity:
Here's an improved version with some of these considerations:
Key Changes:
These changes improve readability, maintainability, and robustness of the code.