Мелкий рефакторинг

This commit is contained in:
Book Pauk
2020-02-02 23:25:28 +07:00
parent 4b270bce8b
commit 2b6f9568de

View File

@@ -298,20 +298,9 @@ class TextPage extends Vue {
this.fontsLoaded[this.fontCssUrl] = 1; this.fontsLoaded[this.fontCssUrl] = 1;
} }
const waitingTime = 10*1000; try {
const delay = 100; await this.checkLoadedFonts();
let i = 0; } catch (e) {
//ждем шрифты
while (i < waitingTime/delay) {
i++;
try {
await this.checkLoadedFonts();
i = waitingTime;
} catch (e) {
await sleep(delay);
}
}
if (i !== waitingTime) {
this.$notify.error({ this.$notify.error({
title: 'Ошибка загрузки', title: 'Ошибка загрузки',
message: 'Некоторые шрифты не удалось загрузить' message: 'Некоторые шрифты не удалось загрузить'