refactor: centralize the code that first opens the project into a single function

This commit is contained in:
Levi Yan
2025-03-02 23:33:18 +08:00
parent b96e318355
commit 04e34d5129
2 changed files with 17 additions and 25 deletions

View File

@@ -15,6 +15,16 @@ export default class RemoteContainer {
this.user = user
}
async firstOpenProject(host: string, port: number, username: string, path: string) {
this.firstConnect(host, username, port)
.then((res) => {
if (res == 'success') {
// only success then open folder
this.openRemoteFolder(host, port, username, path);
}
})
}
async firstConnect(host: string, username: string, port: number): Promise<string>; // connect with key
// deprecated
async firstConnect(host: string, username: string, port: number, password: string): Promise<string>;