Fi issues with field controls not being updated

This commit is contained in:
Webifi 2023-07-16 10:46:14 -05:00
parent 3df166c2fb
commit 155b067236
1 changed files with 13 additions and 3 deletions

View File

@ -17,20 +17,30 @@
export let originalProfile:String export let originalProfile:String
export let rkey:number = 0 export let rkey:number = 0
let fieldControls:ControlAction[]
const chatId = chat.id const chatId = chat.id
let show = false let show = false
const buildFieldControls = () => {
fieldControls = (setting.fieldControls || [] as FieldControl[]).map(fc => {
return fc.getAction(chatId, setting, chatSettings[setting.key])
})
}
buildFieldControls()
onMount(() => { onMount(() => {
show = (typeof setting.hide !== 'function') || !setting.hide(chatId) show = (typeof setting.hide !== 'function') || !setting.hide(chatId)
buildFieldControls()
}) })
afterUpdate(() => { afterUpdate(() => {
show = (typeof setting.hide !== 'function') || !setting.hide(chatId) show = (typeof setting.hide !== 'function') || !setting.hide(chatId)
buildFieldControls()
}) })
const fieldControls:ControlAction[] = (setting.fieldControls || [] as FieldControl[]).map(fc => {
return fc.getAction(chatId, setting, chatSettings[setting.key])
})
if (originalProfile) { if (originalProfile) {
// eventually... // eventually...