Add closing busy dialog

Signed-off-by: trivernis <trivernis@protonmail.com>
pull/4/head
trivernis 3 years ago
parent 25a64623f4
commit 8007bf64a7

@ -1489,8 +1489,8 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
[[package]] [[package]]
name = "mediarepo-api" name = "mediarepo-api"
version = "0.24.2" version = "0.25.0"
source = "git+https://github.com/Trivernis/mediarepo-api.git?rev=076e9f344da034fc70c99cb1b9c4359374acc2ca#076e9f344da034fc70c99cb1b9c4359374acc2ca" source = "git+https://github.com/Trivernis/mediarepo-api.git?rev=cd7bcc8d688d05275679d20af71231098602009b#cd7bcc8d688d05275679d20af71231098602009b"
dependencies = [ dependencies = [
"async-trait", "async-trait",
"bromine", "bromine",

@ -25,7 +25,7 @@ features = [ "env-filter" ]
[dependencies.mediarepo-api] [dependencies.mediarepo-api]
git = "https://github.com/Trivernis/mediarepo-api.git" git = "https://github.com/Trivernis/mediarepo-api.git"
rev = "076e9f344da034fc70c99cb1b9c4359374acc2ca" rev = "cd7bcc8d688d05275679d20af71231098602009b"
features = [ "tauri-plugin" ] features = [ "tauri-plugin" ]
[features] [features]

@ -12,6 +12,10 @@ import {
} from "../../../../services/repository/repository.service"; } from "../../../../services/repository/repository.service";
import {RepositoryMetadata} from "../../../../models/RepositoryMetadata"; import {RepositoryMetadata} from "../../../../models/RepositoryMetadata";
import {BehaviorSubject} from "rxjs"; import {BehaviorSubject} from "rxjs";
import {MatDialog} from "@angular/material/dialog";
import {
BusyDialogComponent
} from "../../../shared/app-common/busy-dialog/busy-dialog.component";
@Component({ @Component({
selector: "app-repository-details-view", selector: "app-repository-details-view",
@ -29,7 +33,7 @@ export class RepositoryDetailsViewComponent implements OnInit, OnChanges, OnDest
public thumbFolderSize = new BehaviorSubject<string | undefined>(undefined); public thumbFolderSize = new BehaviorSubject<string | undefined>(undefined);
public databaseFileSize = new BehaviorSubject<string | undefined>(undefined); public databaseFileSize = new BehaviorSubject<string | undefined>(undefined);
constructor(private repoService: RepositoryService) { constructor(private repoService: RepositoryService, public dialog: MatDialog) {
} }
public async ngOnInit() { public async ngOnInit() {
@ -48,11 +52,18 @@ export class RepositoryDetailsViewComponent implements OnInit, OnChanges, OnDest
} }
public async closeRepository() { public async closeRepository() {
let closeDialog = this.dialog.open(BusyDialogComponent, {
data: {
title: "Closing repository",
message: new BehaviorSubject("Closing repository...")
}
});
if (this.repository?.local) { if (this.repository?.local) {
await this.repoService.closeSelectedRepository(); await this.repoService.closeSelectedRepository();
} else { } else {
await this.repoService.disconnectSelectedRepository(); await this.repoService.disconnectSelectedRepository();
} }
closeDialog.close(true);
} }
public async getSizes() { public async getSizes() {

Loading…
Cancel
Save