more fixes

This commit is contained in:
Drew Ansbacher
2021-09-14 23:07:08 -06:00
committed by Aiden McClelland
parent 2f918c198f
commit 5610ab135b
5 changed files with 15 additions and 6 deletions

View File

@@ -17,7 +17,7 @@
<ng-container *ngIf="!loading && !storageDrives.length">
<h2 color="light">No drives found</h2>
<p color="light">Please connect an storage drive to your Embassy and refresh the page.</p>
<ion-button style="margin-top: 25px;" (click)="window.location.reload()" color="light">
<ion-button style="margin-top: 25px;" (click)="refresh()" color="light">
Refresh
</ion-button>
</ng-container>

View File

@@ -27,6 +27,17 @@ export class EmbassyPage {
) { }
async ngOnInit () {
await this.getDrives()
}
async refresh () {
this.storageDrives = []
this.selectedDrive = null
this.loading = true
await this.getDrives()
}
async getDrives () {
try {
this.storageDrives = await this.apiService.getDrives()
} catch (e) {