mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-24 01:07:50 +00:00
QFIX: undefined exception (#7716)
This commit is contained in:
parent
2613e625c9
commit
599b7b3375
@ -228,18 +228,22 @@
|
|||||||
if (listListCategory?.[0] == null) {
|
if (listListCategory?.[0] == null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const obj = listListCategory[0].getLimited()[0]
|
const obj = listListCategory[0]?.getLimited()?.[0]
|
||||||
listListCategory[0].expand()
|
if (obj !== undefined) {
|
||||||
select(0, obj)
|
listListCategory[0]?.expand()
|
||||||
|
select(0, obj)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
if (listListCategory?.[0] == null) {
|
if (listListCategory?.[0] == null) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const g = listListCategory[categories.length - 1].getLimited()
|
const g = listListCategory[categories.length - 1]?.getLimited() ?? []
|
||||||
listListCategory[categories.length - 1].expand()
|
if (g.length > 0) {
|
||||||
const obj = g[g.length - 1]
|
listListCategory[categories.length - 1].expand()
|
||||||
select(0, obj)
|
const obj = g[g.length - 1]
|
||||||
|
select(0, obj)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -297,17 +301,21 @@
|
|||||||
if (dir === undefined || dir === 'vertical') {
|
if (dir === undefined || dir === 'vertical') {
|
||||||
if (statePos - 1 < 0 && objState >= 0) {
|
if (statePos - 1 < 0 && objState >= 0) {
|
||||||
if (objState !== 0) {
|
if (objState !== 0) {
|
||||||
const pstateObjs = listListCategory[objState - 1].getLimited()
|
const pstateObjs = listListCategory[objState - 1]?.getLimited()
|
||||||
dispatch('select', pstateObjs[pstateObjs.length - 1])
|
if (pstateObjs !== undefined) {
|
||||||
|
dispatch('select', pstateObjs[pstateObjs.length - 1])
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dispatch('select-prev', stateObjs[statePos])
|
dispatch('select-prev', stateObjs[statePos])
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const obj = stateObjs[statePos - 1]
|
const obj = stateObjs[statePos - 1]
|
||||||
if (obj !== undefined) {
|
if (obj !== undefined) {
|
||||||
const focusDoc = listListCategory[objState]?.getLimited().find((it) => it._id === obj._id) ?? obj
|
const focusDoc = listListCategory[objState]?.getLimited()?.find((it) => it._id === obj._id) ?? obj
|
||||||
if (!noScroll) scrollInto(objState, focusDoc)
|
if (focusDoc !== undefined) {
|
||||||
dispatch('row-focus', focusDoc)
|
if (!noScroll) scrollInto(objState, focusDoc)
|
||||||
|
dispatch('row-focus', focusDoc)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -315,7 +323,7 @@
|
|||||||
}
|
}
|
||||||
if (offset === 1) {
|
if (offset === 1) {
|
||||||
if (dir === undefined || dir === 'vertical') {
|
if (dir === undefined || dir === 'vertical') {
|
||||||
const limited = listListCategory[objState].getLimited()
|
const limited = listListCategory[objState]?.getLimited() ?? []
|
||||||
if (statePos + 1 >= limited.length && objState < categories.length) {
|
if (statePos + 1 >= limited.length && objState < categories.length) {
|
||||||
if (objState + 1 !== categories.length) {
|
if (objState + 1 !== categories.length) {
|
||||||
const pstateObjs = getGroupByValues(groupByDocs, categories[objState + 1])
|
const pstateObjs = getGroupByValues(groupByDocs, categories[objState + 1])
|
||||||
@ -326,18 +334,22 @@
|
|||||||
} else {
|
} else {
|
||||||
const obj = stateObjs[statePos + 1]
|
const obj = stateObjs[statePos + 1]
|
||||||
if (obj !== undefined) {
|
if (obj !== undefined) {
|
||||||
const focusDoc = listListCategory[objState]?.getLimited().find((it) => it._id === obj._id) ?? obj
|
const focusDoc = listListCategory[objState]?.getLimited()?.find((it) => it._id === obj._id) ?? obj
|
||||||
if (!noScroll) scrollInto(objState, focusDoc)
|
if (focusDoc !== undefined) {
|
||||||
dispatch('row-focus', focusDoc)
|
if (!noScroll) scrollInto(objState, focusDoc)
|
||||||
|
dispatch('row-focus', focusDoc)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (offset === 0) {
|
if (offset === 0) {
|
||||||
const focusDoc = listListCategory[objState]?.getLimited().find((it) => it._id === obj._id) ?? obj
|
const focusDoc = listListCategory[objState]?.getLimited()?.find((it) => it._id === obj._id) ?? obj
|
||||||
if (!noScroll) scrollInto(objState, focusDoc)
|
if (focusDoc !== undefined) {
|
||||||
dispatch('row-focus', focusDoc)
|
if (!noScroll) scrollInto(objState, focusDoc)
|
||||||
|
dispatch('row-focus', focusDoc)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
listCategory[objState]?.select(offset, of, dir, noScroll)
|
listCategory[objState]?.select(offset, of, dir, noScroll)
|
||||||
|
Loading…
Reference in New Issue
Block a user