summaryrefslogtreecommitdiff
path: root/src/components/ConnectionTable.js
diff options
context:
space:
mode:
authorHaishan <[email protected]>2019-12-01 22:41:59 +0800
committerHaishan <[email protected]>2019-12-01 22:41:59 +0800
commit8b5ecb3f1839808d5e88f635d286fcfdfffd4f86 (patch)
treefbbaef42b57a1fe3cb244103ccbb58915e631c66 /src/components/ConnectionTable.js
parent19ecf435de90800fe284e3333b3a4957d600f410 (diff)
feat: support close all connections
for https://github.com/haishanh/yacd/issues/338
Diffstat (limited to 'src/components/ConnectionTable.js')
-rw-r--r--src/components/ConnectionTable.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/components/ConnectionTable.js b/src/components/ConnectionTable.js
index 17293c0..2e7ba7f 100644
--- a/src/components/ConnectionTable.js
+++ b/src/components/ConnectionTable.js
@@ -34,6 +34,13 @@ function renderCell(cell, now) {
}
}
+const tableState = {
+ sortBy: [
+ // maintain a more stable order
+ { id: 'start', desc: true }
+ ]
+};
+
function Table({ data }) {
const now = new Date();
const {
@@ -45,7 +52,8 @@ function Table({ data }) {
} = useTable(
{
columns,
- data
+ data,
+ initialState: tableState
},
useSortBy
);