Мелкий рефакторинг
This commit is contained in:
@@ -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: 'Некоторые шрифты не удалось загрузить'
|
||||||
|
|||||||
Reference in New Issue
Block a user