diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/add-repository-dialog/add-repository-dialog.component.ts b/mediarepo-ui/src/app/components/core/repositories-tab/add-repository-dialog/add-repository-dialog.component.ts index 5409473..7db16d3 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/add-repository-dialog/add-repository-dialog.component.ts +++ b/mediarepo-ui/src/app/components/core/repositories-tab/add-repository-dialog/add-repository-dialog.component.ts @@ -57,7 +57,11 @@ export class AddRepositoryDialogComponent implements OnInit { public async initLocalRepository() { const path = this.formGroup.value.path; - await this.repoService.initRepository(path); + try { + await this.repoService.initRepository(path); + } catch (err) { + this.errorBroker.showError(err); + } await this.checkLocalRepoExists(); } diff --git a/mediarepo-ui/src/app/components/core/repositories-tab/repository-card/repository-card.component.ts b/mediarepo-ui/src/app/components/core/repositories-tab/repository-card/repository-card.component.ts index 77eeb02..66f964b 100644 --- a/mediarepo-ui/src/app/components/core/repositories-tab/repository-card/repository-card.component.ts +++ b/mediarepo-ui/src/app/components/core/repositories-tab/repository-card/repository-card.component.ts @@ -54,6 +54,13 @@ export class RepositoryCardComponent implements OnInit, OnDestroy { } }).afterClosed().subscribe(async confirmation => { if (confirmation === true) { + if (this.isSelectedRepository()) { + if (this.repository.local) { + await this.repoService.closeSelectedRepository(); + } else { + await this.repoService.disconnectSelectedRepository(); + } + } await this.repoService.removeRepository(this.repository.name); } });