Fix broken Settings dialog in browsers that doesn't support queryLocalFonts()

This commit is contained in:
Jonatan Heyman 2024-01-08 21:36:34 +01:00
parent 780a949a73
commit f0927add74

View File

@ -46,9 +46,11 @@
},
async mounted() {
let localFonts = [... new Set((await window.queryLocalFonts()).map(f => f.family))].filter(f => f !== "Hack")
localFonts = [...new Set(localFonts)].map(f => [f, f])
this.systemFonts = [[defaultFontFamily, defaultFontFamily + " (default)"], ...localFonts]
if (window.queryLocalFonts !== undefined) {
let localFonts = [... new Set((await window.queryLocalFonts()).map(f => f.family))].filter(f => f !== "Hack")
localFonts = [...new Set(localFonts)].map(f => [f, f])
this.systemFonts = [[defaultFontFamily, defaultFontFamily + " (default)"], ...localFonts]
}
window.addEventListener("keydown", this.onKeyDown);
this.$refs.keymapSelector.focus()