[Glitch] fix: Fix TypeError on pages with empty feeds
Port 6fc77a545bef8c15cdc262f100efc2915c5900ed to glitch-soc Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
parent
d235b2ce62
commit
3f980d6751
@ -42,9 +42,11 @@ export default class StatusList extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
this.columnHeaderHeight = parseFloat(
|
this.columnHeaderHeight = this.node?.node
|
||||||
getComputedStyle(this.node.node).getPropertyValue('--column-header-height')
|
? parseFloat(
|
||||||
) || 0;
|
getComputedStyle(this.node.node).getPropertyValue('--column-header-height')
|
||||||
|
) || 0
|
||||||
|
: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFeaturedStatusCount = () => {
|
getFeaturedStatusCount = () => {
|
||||||
@ -70,8 +72,8 @@ export default class StatusList extends ImmutablePureComponent {
|
|||||||
};
|
};
|
||||||
|
|
||||||
_selectChild = (id, index, direction) => {
|
_selectChild = (id, index, direction) => {
|
||||||
const listContainer = this.node.node;
|
const listContainer = this.node?.node;
|
||||||
let listItem = listContainer.querySelector(
|
let listItem = listContainer?.querySelector(
|
||||||
// :nth-child uses 1-based indexing
|
// :nth-child uses 1-based indexing
|
||||||
`.item-list > :nth-child(${index + 1 + direction})`
|
`.item-list > :nth-child(${index + 1 + direction})`
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user