refactor: add error processing for first connecting remote container

This commit is contained in:
Levi Yan
2024-10-15 17:13:58 +08:00
parent 2b0875d0a8
commit cdb6c425e5

View File

@@ -32,11 +32,13 @@ export default class DSHome {
switch (message.command) {
case 'firstOpenRemoteFolder':
await this.remoteContainer.firstConnect(message.host, message.username, message.password, message.port)
.then((result) => {
if (result === 'success') {
// only success then open folder
this.remoteContainer.openRemoteFolder(message.host, message.path);
}
.then((_res) => {
if (_res == 'success') {
// only success then open folder
this.remoteContainer.openRemoteFolder(message.host, message.path);
}
}).catch(error => {
console.error(`Failed to connect ${message.host}: `, error)
})
break;
case 'openRemoteFolder':