diff --git a/src/modules/pages/connection/list/list_item/list_item.model.ts b/src/modules/pages/connection/list/list_item/list_item.model.ts index d112a42..6db6b3e 100644 --- a/src/modules/pages/connection/list/list_item/list_item.model.ts +++ b/src/modules/pages/connection/list/list_item/list_item.model.ts @@ -76,7 +76,6 @@ export class ListItemModel extends Model<{ return api.updateConnection(connection).then(re => { if (!re.errorCode) { - this.setIsEdit(false, oldName); this.model.connections = this.model.connections.map(item => { return { ...item, diff --git a/src/modules/pages/connection/list/list_item/list_item.ts b/src/modules/pages/connection/list/list_item/list_item.ts index cd1faa3..e0bd557 100644 --- a/src/modules/pages/connection/list/list_item/list_item.ts +++ b/src/modules/pages/connection/list/list_item/list_item.ts @@ -73,11 +73,12 @@ export class ListItem extends BI.BasicButton { action: () => { const newName = this.nameEditor.getValue(); this.store.changeName(name, newName).then(re => { + this.store.setIsEdit(false, name); if (re.errorCode) { BI.Msg.toast(BI.i18nText(re.errorMsg), { level: 'error', }); - this.nameEditor.focus(); + this.nameLabel.setText(name); } else { this.nameLabel.setText(newName); }