mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
fix feed collapsing due to unstable row IDs
This commit is contained in:
@@ -77,13 +77,26 @@
|
|||||||
feedTable.value.pageSizeLinked ? appearanceSettingsStore.tablePageSize : feedTable.value.pageSize
|
feedTable.value.pageSizeLinked ? appearanceSettingsStore.tablePageSize : feedTable.value.pageSize
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function getFeedRowId(row) {
|
||||||
|
if (row?.id != null) return `id:${row.id}`;
|
||||||
|
if (row?.rowId != null) return `row:${row.rowId}`;
|
||||||
|
|
||||||
|
const type = row?.type ?? '';
|
||||||
|
const createdAt = row?.created_at ?? row?.createdAt ?? '';
|
||||||
|
const userId = row?.userId ?? row?.senderUserId ?? '';
|
||||||
|
const location = row?.location ?? row?.details?.location ?? '';
|
||||||
|
const message = row?.message ?? '';
|
||||||
|
|
||||||
|
return `${type}:${createdAt}:${userId}:${location}:${message}`;
|
||||||
|
}
|
||||||
|
|
||||||
const { table, pagination } = useVrcxVueTable({
|
const { table, pagination } = useVrcxVueTable({
|
||||||
get data() {
|
get data() {
|
||||||
return feedTableData.value;
|
return feedTableData.value;
|
||||||
},
|
},
|
||||||
persistKey: 'feed',
|
persistKey: 'feed',
|
||||||
columns: baseColumns,
|
columns: baseColumns,
|
||||||
getRowId: (row, index) => `${row.type}:${row.created_at ?? ''}:${row.rowId ?? index}`,
|
getRowId: getFeedRowId,
|
||||||
enableExpanded: true,
|
enableExpanded: true,
|
||||||
getRowCanExpand: () => true,
|
getRowCanExpand: () => true,
|
||||||
initialSorting: [],
|
initialSorting: [],
|
||||||
@@ -91,6 +104,9 @@
|
|||||||
initialPagination: {
|
initialPagination: {
|
||||||
pageIndex: 0,
|
pageIndex: 0,
|
||||||
pageSize: pageSize.value
|
pageSize: pageSize.value
|
||||||
|
},
|
||||||
|
tableOptions: {
|
||||||
|
autoResetExpanded: false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user