fix loading max emoji count when unlimited

This commit is contained in:
Johann150 2022-09-16 17:25:05 +02:00
parent bcb93aec14
commit 1e9e1e8b9c
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -148,11 +148,11 @@ const squareAvatars = computed(defaultStore.makeGetterSetter('squareAvatars'));
For these two, the sliders go to 25, but 25 should be mapped to "unlimited". For these two, the sliders go to 25, but 25 should be mapped to "unlimited".
"Unlimited" is stored internally as 0 so the modulo is necessary. "Unlimited" is stored internally as 0 so the modulo is necessary.
*/ */
let maxCustomEmojiPicker = $ref(defaultStore.state.maxCustomEmojiPicker); let maxCustomEmojiPicker = $ref(defaultStore.state.maxCustomEmojiPicker || 25);
watch($$(maxCustomEmojiPicker), () => { watch($$(maxCustomEmojiPicker), () => {
defaultStore.set('maxCustomEmojiPicker', maxCustomEmojiPicker % 25); defaultStore.set('maxCustomEmojiPicker', maxCustomEmojiPicker % 25);
}); });
let maxUnicodeEmojiPicker = $ref(defaultStore.state.maxUnicodeEmojiPicker); let maxUnicodeEmojiPicker = $ref(defaultStore.state.maxUnicodeEmojiPicker || 25);
watch($$(maxUnicodeEmojiPicker), () => { watch($$(maxUnicodeEmojiPicker), () => {
defaultStore.set('maxUnicodeEmojiPicker', maxUnicodeEmojiPicker % 25); defaultStore.set('maxUnicodeEmojiPicker', maxUnicodeEmojiPicker % 25);
}); });