refactor: only successfully finished first connect then open remote folder

This commit is contained in:
Levi Yan
2024-07-30 23:35:08 +08:00
parent 9b95f6376c
commit 3b7cf8af57
2 changed files with 44 additions and 35 deletions

View File

@@ -31,8 +31,13 @@ export default class DSHome {
async (message) => {
switch (message.command) {
case 'firstOpenRemoteFolder':
await this.remoteContainer.firstConnect(message.host, message.username, message.password, message.port);
this.remoteContainer.openRemoteFolder(message.host, message.path);
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);
}
})
return;
case 'openRemoteFolder':
this.remoteContainer.openRemoteFolder(message.host, message.path);