refactor: centralize the code that first opens the project into a single function
This commit is contained in:
@@ -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>;
|
||||
|
Reference in New Issue
Block a user