This repository was archived by the owner on Oct 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-13
lines changed
views/dashboard/components/inboxThread Expand file tree Collapse file tree 2 files changed +18
-13
lines changed Original file line number Diff line number Diff line change 22import qs from 'query-string' ;
33import { storeItem } from 'src/helpers/localStorage' ;
44import { LAST_ACTIVE_COMMUNITY_KEY } from 'src/views/dashboard/components/communityList' ;
5- import { history } from 'src/helpers/history' ;
65
76export const changeActiveThread = ( threadId : ?string ) => {
8- let search = qs . parse ( history . location . search ) ;
9- search . t = threadId ;
10- history . push ( {
11- ...history . location ,
12- search : qs . stringify ( search ) ,
13- } ) ;
147 return {
158 type : 'SELECT_FEED_THREAD' ,
169 threadId,
Original file line number Diff line number Diff line change @@ -67,14 +67,26 @@ class InboxThread extends React.Component<Props> {
6767 < ErrorBoundary fallbackComponent = { null } >
6868 < InboxThreadItem data-cy = "thread-card" active = { active } >
6969 < InboxLinkWrapper
70- to = { {
71- pathname : getThreadLink ( thread ) ,
72- state : { modal : ! isInbox } ,
73- } }
70+ to = {
71+ isInbox
72+ ? {
73+ pathname : location . pathname ,
74+ search : `?t=${ thread . id } ` ,
75+ }
76+ : {
77+ pathname : getThreadLink ( thread ) ,
78+ state : { modal : true } ,
79+ }
80+ }
7481 onClick = { evt => {
75- const isDesktopInbox = isInbox && window . innerWidth > 768 ;
76- if ( isDesktopInbox ) {
82+ const isMobile = window . innerWidth < 768 ;
83+ if ( isMobile && isInbox ) {
7784 evt . preventDefault ( ) ;
85+ this . props . history . push ( {
86+ pathname : getThreadLink ( thread ) ,
87+ state : { modal : true } ,
88+ } ) ;
89+ } else if ( ! isMobile ) {
7890 this . props . dispatch ( changeActiveThread ( thread . id ) ) ;
7991 }
8092 } }
You can’t perform that action at this time.
0 commit comments