Skip to content

Commit

Permalink
ui(jar): hide empty internal change accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Oct 31, 2023
1 parent 3b45e3a commit 80b2e14
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
11 changes: 1 addition & 10 deletions src/components/jar_details/DisplayBranch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { useTranslation } from 'react-i18next'
import Balance from '../Balance'
import { useSettings } from '../../context/SettingsContext'
import { Branch, BranchEntry } from '../../context/WalletContext'
import styles from './DisplayBranch.module.css'
import { CopyButton } from '../CopyButton'
import Sprite from '../Sprite'
import styles from './DisplayBranch.module.css'

const toHdPathIndex = (hdPath: string) => {
const indexOfLastSeparator = hdPath.lastIndexOf('/')
Expand Down Expand Up @@ -76,15 +76,6 @@ export function DisplayBranchBody({ branch }: DisplayBranchProps) {
)
}

export default function DisplayBranch({ branch }: DisplayBranchProps) {
return (
<article>
<DisplayBranchHeader branch={branch} />
<DisplayBranchBody branch={branch} />
</article>
)
}

interface DisplayBranchEntryProps extends rb.CardProps {
entry: BranchEntry
}
Expand Down
22 changes: 12 additions & 10 deletions src/components/jar_details/JarDetailsOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -414,16 +414,18 @@ const JarDetailsOverlay = (props: JarDetailsOverlayProps) => {
</>
) : (
<rb.Accordion flush className="p-3 p-lg-0">
{jar.branches.map((branch, index) => (
<rb.Accordion.Item className={styles.jarItem} key={branch.branch} eventKey={`${index}`}>
<rb.Accordion.Header>
<DisplayBranchHeader branch={branch} />
</rb.Accordion.Header>
<rb.Accordion.Body>
<DisplayBranchBody branch={branch} />
</rb.Accordion.Body>
</rb.Accordion.Item>
))}
{jar.branches
.filter((it) => it.entries.length > 0)
.map((branch, index) => (
<rb.Accordion.Item className={styles.jarItem} key={branch.branch} eventKey={`${index}`}>
<rb.Accordion.Header>
<DisplayBranchHeader branch={branch} />
</rb.Accordion.Header>
<rb.Accordion.Body>
<DisplayBranchBody branch={branch} />
</rb.Accordion.Body>
</rb.Accordion.Item>
))}
</rb.Accordion>
)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/context/ServiceInfoContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ const ServiceInfoProvider = ({ children }: PropsWithChildren<{}>) => {
})
.catch((err) => {
if (!signal.aborted) {
const isUnauthorized = err instanceof Api.JmApiError && err.response.status === 401
const isUnauthorized = err instanceof Api.JmApiError && err.response?.status === 401
if (isUnauthorized) {
resetWalletAndClearSession()
} else {
Expand Down

0 comments on commit 80b2e14

Please sign in to comment.