fix font selector losing list of local fonts when selecting one
This commit is contained in:
parent
665faf892a
commit
4d3d075151
|
@ -50,10 +50,11 @@ export default {
|
||||||
return typeof this.modelValue !== 'undefined'
|
return typeof this.modelValue !== 'undefined'
|
||||||
},
|
},
|
||||||
localFontsList () {
|
localFontsList () {
|
||||||
return this.$store.state.interface.localFonts?.values()
|
console.log('FONTLIST', this.$store.state.interface.localFonts?.values())
|
||||||
|
return this.$store.state.interface.localFonts
|
||||||
},
|
},
|
||||||
localFontsSize () {
|
localFontsSize () {
|
||||||
return this.$store.state.interface.localFonts?.size
|
return this.$store.state.interface.localFonts?.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,7 @@
|
||||||
</button>
|
</button>
|
||||||
<Select
|
<Select
|
||||||
:id="name + '-local-font-switcher'"
|
:id="name + '-local-font-switcher'"
|
||||||
:model-value="modelValue.family"
|
:model-value="modelValue?.family"
|
||||||
class="custom-font"
|
class="custom-font"
|
||||||
@update:modelValue="v => $emit('update:modelValue', { ...(modelValue || {}), family: v })"
|
@update:modelValue="v => $emit('update:modelValue', { ...(modelValue || {}), family: v })"
|
||||||
>
|
>
|
||||||
|
|
|
@ -112,7 +112,8 @@ const interfaceMod = {
|
||||||
state.lastTimeline = value
|
state.lastTimeline = value
|
||||||
},
|
},
|
||||||
setFontsList (state, value) {
|
setFontsList (state, value) {
|
||||||
state.localFonts = new Set(value.map(font => font.family))
|
// Set is used here so that we filter out duplicate fonts (possibly same font but with different weight)
|
||||||
|
state.localFonts = [...(new Set(value.map(font => font.family))).values()]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|
Loading…
Reference in a new issue