Fixed broken translations for snackbars

This commit is contained in:
Isaac Abadi
2022-06-23 01:22:22 -04:00
parent 2ba1dc6333
commit a2d1b154a3
8 changed files with 151 additions and 77 deletions

View File

@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { PostsService } from 'app/posts.services';
import { MatSnackBar } from '@angular/material/snack-bar';
import { UpdaterStatus } from '../../../api-types';
@Component({
@@ -14,7 +13,7 @@ export class UpdateProgressDialogComponent implements OnInit {
updateInterval = 250;
errored = false;
constructor(private postsService: PostsService, private snackBar: MatSnackBar) { }
constructor(private postsService: PostsService) { }
ngOnInit(): void {
this.getUpdateProgress();
@@ -28,16 +27,9 @@ export class UpdateProgressDialogComponent implements OnInit {
if (res) {
this.updateStatus = res;
if (this.updateStatus && this.updateStatus['error']) {
this.openSnackBar('Update failed. Check logs for more details.');
this.postsService.openSnackBar($localize`Update failed. Check logs for more details.`);
}
}
});
}
public openSnackBar(message: string, action: string = '') {
this.snackBar.open(message, action, {
duration: 2000,
});
}
}