-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Happychat: Rework selected site logic to send proper site info to happychat and kayako #15013
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { getPrimarySiteId } from 'state/selectors'; | ||
import { getRawSite } from 'state/sites/selectors'; | ||
import createSelector from 'lib/create-selector'; | ||
|
||
export const getHelpSelectedSiteId = createSelector( | ||
state => state.help.selectedSiteId | ||
); | ||
|
||
export const getHelpSelectedSite = ( state ) => { | ||
const siteId = getHelpSelectedSiteId( state ) || getPrimarySiteId( state ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you should be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, I didn't notice that it was added. Updated, thanks. |
||
|
||
return getRawSite( state, siteId ); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're only using the ID can we just pass
selectedSiteId
instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that if we ever need any other site details in the future they'll be there, I guess I could just send the id for now and we could rework it later.