Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLD - Fixed accounts order after changing countervalue in the settings #6096

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/khaki-poems-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

LLD - Fixed accounts order after changing countervalue in the settings
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import React, { useCallback } from "react";
import React, { useCallback, useMemo } from "react";
import { useSelector } from "react-redux";
import { useHistory } from "react-router-dom";
import styled from "styled-components";
import { Account, AccountLike } from "@ledgerhq/types-live";
import TrackPage, { setTrackingSource } from "~/renderer/analytics/TrackPage";
import Box from "~/renderer/components/Box";
import { Redirect } from "react-router";
import {
useFlattenSortAccounts,
useRefreshAccountsOrderingEffect,
} from "~/renderer/actions/general";
import { useFlattenSortAccounts } from "~/renderer/actions/general";
import { accountsSelector, starredAccountsSelector } from "~/renderer/reducers/accounts";
import { accountsViewModeSelector, selectedTimeRangeSelector } from "~/renderer/reducers/settings";
import AccountList from "./AccountList";
Expand All @@ -23,11 +20,12 @@ export default function AccountsPage() {
const flattenedAccounts = useFlattenSortAccounts({
enforceHideEmptySubAccounts: true,
});
const accounts = mode === "card" ? flattenedAccounts : rawAccounts;
const accounts = useMemo(
() => (mode === "card" ? flattenedAccounts : rawAccounts),
[mode, flattenedAccounts, rawAccounts],
);
const history = useHistory();
useRefreshAccountsOrderingEffect({
onMount: true,
});

const onAccountClick = useCallback(
(account: AccountLike, parentAccount?: Account | null) => {
setTrackingSource("accounts page");
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading