fix setTab expr

This commit is contained in:
Ruben Fiszel
2024-01-26 00:53:28 +01:00
parent 5d0ef32b3e
commit d1fab8449f
2 changed files with 11 additions and 4 deletions
@@ -29,7 +29,10 @@
configuration: {
gotoUrl: { url: (() => string) | string | undefined; newTab: boolean | undefined }
setTab: {
setTab: { id: string; index: number }[] | undefined
setTab:
| (() => { id: string; index: number }[])
| { id: string; index: number }[]
| undefined
}
sendToast?: {
message: (() => string) | string | undefined
@@ -135,8 +138,11 @@
switch (sideEffect.selected) {
case 'setTab':
const setTab = sideEffect?.configuration.setTab?.setTab
let setTab = sideEffect?.configuration.setTab?.setTab
if (!setTab) return
if (typeof setTab === 'function') {
setTab = await setTab()
}
if (Array.isArray(setTab)) {
setTab.forEach((tab) => {
if (tab) {
@@ -503,7 +503,8 @@ const onErrorClick = {
value: [] as Array<{ id: string; index: number }>,
fieldType: 'array',
subFieldType: 'tab-select',
tooltip: 'Set the tabs id and index to go to on error'
tooltip: 'Set the tabs id and index to go to on error',
onDemandOnly: true
}
},
sendErrorToast: {