mirror of
https://github.com/threefoldtech/mycelium.git
synced 2026-10-23 22:12:20 +00:00
Jump back to first page when sorting on a column
This commit is contained in:
1 parent
dd151acfcf
commit
2507eed6a2
1 file changed
+5
@@ -282,6 +282,7 @@ fn PeersTable(peers: Vec<mycelium::peer_manager::PeerStats>) -> Element {
|
||||
);
|
||||
};
|
||||
|
||||
// Sorting
|
||||
let mut sort_peers_signal = move |column: String| {
|
||||
if column == *sort_column.read() {
|
||||
let new_sort_direction = match *sort_direction.read() {
|
||||
@@ -293,6 +294,8 @@ fn PeersTable(peers: Vec<mycelium::peer_manager::PeerStats>) -> Element {
|
||||
sort_column.set(column);
|
||||
sort_direction.set(SortDirection::Descending);
|
||||
}
|
||||
// When sorting, we should jump back to the first page
|
||||
current_page.set(0);
|
||||
};
|
||||
|
||||
let sorted_peers = use_memo(move || {
|
||||
@@ -496,6 +499,8 @@ fn RoutesTable(routes: Vec<mycelium_api::Route>, table_name: String) -> Element
|
||||
sort_column.set(column);
|
||||
sort_direction.set(SortDirection::Ascending);
|
||||
}
|
||||
// When sorting, we should jump back to the first page
|
||||
current_page.set(0);
|
||||
};
|
||||
|
||||
let sorted_routes = use_memo(move || {
|
||||
|
||||
Reference in new issue
Block a user