Make public methods private in local databases UI

Some of the methods in the `DatabaseUI` were public because they were
used in the `extension.ts` file. We have moved these method calls into
this file, so they do not need to be public anymore. We can also get rid
of the separation between some of these methods, so I've moved them into
the function that calls them.
This commit is contained in:
Koen Vlaswinkel
2023-03-21 14:50:24 +01:00
parent 7ab986fabe
commit bed56ef648

View File

@@ -249,7 +249,7 @@ export class DatabaseUI extends DisposableObject {
await this.databaseManager.setCurrentDatabaseItem(databaseItem);
}
public async chooseDatabaseFolder(
private async chooseDatabaseFolder(
progress: ProgressCallback,
token: CancellationToken,
): Promise<void> {
@@ -410,7 +410,7 @@ export class DatabaseUI extends DisposableObject {
}
}
public async chooseDatabaseArchive(
private async chooseDatabaseArchive(
progress: ProgressCallback,
token: CancellationToken,
): Promise<void> {
@@ -447,23 +447,16 @@ export class DatabaseUI extends DisposableObject {
);
}
public async chooseDatabaseInternet(
progress: ProgressCallback,
token: CancellationToken,
): Promise<DatabaseItem | undefined> {
return await promptImportInternetDatabase(
private async handleChooseDatabaseInternet(): Promise<void> {
return withProgress(
async (progress, token) => {
await promptImportInternetDatabase(
this.databaseManager,
this.storagePath,
progress,
token,
this.queryServer?.cliServer,
);
}
private async handleChooseDatabaseInternet(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseInternet(progress, token);
},
{
title: "Adding database from URL",
@@ -471,13 +464,12 @@ export class DatabaseUI extends DisposableObject {
);
}
public async chooseDatabaseGithub(
progress: ProgressCallback,
token: CancellationToken,
): Promise<DatabaseItem | undefined> {
private async handleChooseDatabaseGithub(): Promise<void> {
return withProgress(
async (progress, token) => {
const credentials = isCanary() ? this.app.credentials : undefined;
return await promptImportGithubDatabase(
await promptImportGithubDatabase(
this.databaseManager,
this.storagePath,
credentials,
@@ -485,12 +477,6 @@ export class DatabaseUI extends DisposableObject {
token,
this.queryServer?.cliServer,
);
}
private async handleChooseDatabaseGithub(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseGithub(progress, token);
},
{
title: "Adding database from GitHub",