mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 17:25:34 +08:00
feat(connections): make connections table sorting state persisted
This commit is contained in:
parent
4b498fa022
commit
6957cb4ddf
@ -196,9 +196,12 @@ export default () => {
|
|||||||
])
|
])
|
||||||
|
|
||||||
const [grouping, setGrouping] = createSignal<GroupingState>([])
|
const [grouping, setGrouping] = createSignal<GroupingState>([])
|
||||||
const [sorting, setSorting] = createSignal<SortingState>([
|
const [sorting, setSorting] = makePersisted(
|
||||||
{ id: CONNECTIONS_TABLE_ACCESSOR_KEY.ConnectTime, desc: true },
|
createSignal<SortingState>([
|
||||||
])
|
{ id: CONNECTIONS_TABLE_ACCESSOR_KEY.ConnectTime, desc: true },
|
||||||
|
]),
|
||||||
|
{ name: 'connectionsTableSorting', storage: localStorage },
|
||||||
|
)
|
||||||
|
|
||||||
const table = createSolidTable({
|
const table = createSolidTable({
|
||||||
state: {
|
state: {
|
||||||
@ -371,8 +374,9 @@ export default () => {
|
|||||||
<td
|
<td
|
||||||
onContextMenu={(e) => {
|
onContextMenu={(e) => {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
typeof cell.renderValue() === 'string' &&
|
|
||||||
void writeClipboard(cell.renderValue() as string)
|
const value = cell.renderValue() as null | string
|
||||||
|
value && writeClipboard(value).catch(() => {})
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{cell.getIsGrouped() ? (
|
{cell.getIsGrouped() ? (
|
||||||
|
Loading…
Reference in New Issue
Block a user