Skip to content

Commit 6fe59f1

Browse files
Merge pull request #4029 from RedisInsight/fe/bugfix/RI-6273-fix-channel-subscription-saved-fix
RI-6273 fix pubsub not saved when switching between pages
2 parents 7efef0e + f152bf2 commit 6fe59f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

redisinsight/ui/src/pages/pub-sub/components/subscription-panel/SubscriptionPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ import ClickableAppendInfo from './components/clickable-append-info'
2020
import styles from './styles.module.scss'
2121

2222
const SubscriptionPanel = () => {
23-
const { messages, isSubscribed, loading, count } = useSelector(pubSubSelector)
23+
const { messages, isSubscribed, subscriptions, loading, count } = useSelector(pubSubSelector)
2424

2525
const dispatch = useDispatch()
2626
const { theme } = useContext(ThemeContext)
2727

2828
const { instanceId = '' } = useParams<{ instanceId: string }>()
2929

30-
const [channels, setChannels] = useState(DEFAULT_SEARCH_MATCH)
30+
const [channels, setChannels] = useState(subscriptions?.length ? subscriptions.map((sub) => sub.channel).join(' ') : DEFAULT_SEARCH_MATCH)
3131

3232
const toggleSubscribe = () => {
3333
dispatch(toggleSubscribeTriggerPubSub(channels))

redisinsight/ui/src/pages/pub-sub/components/subscription-panel/components/patternsInfo/PatternsInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const PatternsInfo = ({ channels }: PatternsInfoProps) => {
2020
<EuiToolTip
2121
anchorClassName={styles.appendIcon}
2222
position="right"
23-
title={<>{channels?.trim().split(' ').map((ch) => <p>{ch}</p>)}</>}
23+
title={<>{channels?.trim().split(' ').map((ch) => <p key={`${ch}`}>{ch}</p>)}</>}
2424
>
2525
<EuiIcon
2626
type="iInCircle"

0 commit comments

Comments
 (0)