Skip to content

Commit

Permalink
fix: 修复没有系统用户弹出提示错误
Browse files Browse the repository at this point in the history
  • Loading branch information
huailei000 committed Feb 16, 2023
1 parent 91820aa commit acb77e4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app/elements/connect/connect.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,21 @@ export class ElementConnectComponent implements OnInit, OnDestroy {
});
}

selectLoginSystemUsers(systemUsers: Array<SystemUser>, node: TreeNode): Promise<ConnectData> {
async selectLoginSystemUsers(systemUsers: Array<SystemUser>, node: TreeNode): Promise<ConnectData> {
let systemUserMaxPriority = this.filterHighestPrioritySystemUsers(systemUsers);
const systemUserId = this._appSvc.getQueryString('system_user');
const noSystemUserMsg = await this._i18n.t('No System User');
const noMatchingConnectionMsg = await this._i18n.t('No Matching Connection');

if (systemUserId) {
systemUserMaxPriority = systemUserMaxPriority.filter(s => {
s.id = systemUserId;
});
}
if (systemUserMaxPriority.length === 0) {
alert(this._i18n.t('No System User'));
alert(noSystemUserMsg);
return new Promise<ConnectData>((resolve, reject) => {
reject(this._i18n.t('No System User'));
reject(noSystemUserMsg);
});
} else if (systemUserMaxPriority.length > 1) {
return this.getConnectData(systemUserMaxPriority, node);
Expand All @@ -321,9 +324,9 @@ export class ElementConnectComponent implements OnInit, OnDestroy {
const isRemoteApp = node.meta.type === 'application';
const connectTypes = this._appSvc.getProtocolConnectTypes(isRemoteApp)[systemUser.protocol];
if (!connectTypes) {
alert(this._i18n.t('No Matching Connection'));
alert(noMatchingConnectionMsg);
return new Promise<ConnectData>((resolve, reject) => {
reject(this._i18n.t('No Matching Connection'));
reject(noMatchingConnectionMsg);
});
}
let connectType = null;
Expand Down

0 comments on commit acb77e4

Please sign in to comment.