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

runfix: update the view on opening deep link from the connect tab (WPB-9507) #17812

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

V-Gira
Copy link
Contributor

@V-Gira V-Gira commented Jul 23, 2024

BugWPB-9507 [Web] Opening conversation via deeplink does not update the view

Description

Opening a deep link from the connect tab should switch the sidebar to a view where the conversation is displayed, this switches to the Recent view

Since the app initialize opening the last conversation, we do not store the state of the sidebar when it's set to Connect (in addition to Preferences), since this state does not show the conversation list

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 46.37%. Comparing base (229fb3a) to head (a57b7ca).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev   #17812      +/-   ##
==========================================
- Coverage   46.39%   46.37%   -0.02%     
==========================================
  Files         771      771              
  Lines       25164    25164              
  Branches     5752     5752              
==========================================
- Hits        11675    11671       -4     
- Misses      12013    12016       +3     
- Partials     1476     1477       +1     

@@ -60,7 +60,8 @@ const useSidebarStore = create<SidebarStore>()(
storage: createJSONStorage(() => localStorage),
partialize: state => ({
status: state.status,
currentTab: state.currentTab === SidebarTabs.PREFERENCES ? SidebarTabs.RECENT : state.currentTab,
currentTab:
state.currentTab === SidebarTabs.PREFERENCES || SidebarTabs.CONNECT ? SidebarTabs.RECENT : state.currentTab,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be more like [SidebarTabs.PREFERENCES, SidebarTabs.CONNECT].includes(state.currentTab) ? SidebarTabs.RECENT : state.currentTab

if state.currentTab is different than preferences, it will resolve to false and go to OR statement and then SidebarTabs.CONNECT itself is always truthy so it will always be SidebarTabs.RECENT 🤔

Copy link

sonarcloud bot commented Jul 24, 2024

@V-Gira V-Gira merged commit ef9d443 into dev Jul 24, 2024
11 checks passed
@V-Gira V-Gira deleted the v/connect-deep-links branch July 24, 2024 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants