Skip to content

Commit

Permalink
Merge pull request #2631 from kaloudis/zeus-2621
Browse files Browse the repository at this point in the history
ZEUS-2621: Channels list: persist selection on reload
  • Loading branch information
kaloudis authored Dec 16, 2024
2 parents 5d265b4 + 572bfdc commit 536736c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions views/Channels/ChannelsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export default class ChannelsPane extends React.PureComponent<ChannelsProps> {
filteredPendingChannels,
filteredClosedChannels,
showSearch,
setChannelsType
setChannelsType,
channelsType
} = ChannelsStore!;

const { settings } = SettingsStore!;
Expand Down Expand Up @@ -265,6 +266,15 @@ export default class ChannelsPane extends React.PureComponent<ChannelsProps> {
'views.Wallet.Wallet.closed'
)} (${filteredClosedChannels?.length || 0})`;

let initialRoute;
if (channelsType === ChannelsType.Open) {
initialRoute = openChannelsTabName;
} else if (channelsType === ChannelsType.Pending) {
initialRoute = pendingChannelsTabName;
} else if (channelsType === ChannelsType.Closed) {
initialRoute = closedChannelsTabName;
}

return (
<View style={{ flex: 1 }}>
<WalletHeader
Expand Down Expand Up @@ -304,7 +314,7 @@ export default class ChannelsPane extends React.PureComponent<ChannelsProps> {
ref={this.tabNavigationRef}
>
<Tab.Navigator
initialRouteName={openChannelsTabName}
initialRouteName={initialRoute}
backBehavior="none"
screenOptions={() => ({
headerShown: false,
Expand Down

0 comments on commit 536736c

Please sign in to comment.