Adds a convenience hook to get CSAT in React components. Ideally, it'd be best to get these from Redux / Context, but getAuthMetadata() is async so I need to use state + effect.
Let me know if there's a better way.
Depends on D10908.
Differential D10909
[lib] Add hook for easy access to CSAT bartek on Feb 1 2024, 4:04 AM. Authored by Tags None Referenced Files
Subscribers
Details Adds a convenience hook to get CSAT in React components. Ideally, it'd be best to get these from Redux / Context, but getAuthMetadata() is async so I need to use state + effect. Depends on D10908. Flow. This is used extensively and tested in the next diff.
Diff Detail
Event TimelineComment Actions This is quite fragile - it should work because in identity context we select commServicesAccessToken, and when it changes, we create a new value of getAuthMetadata function. Also, accessToken and userID are exposed by the same emitter. Can't we await identityContext?.getAuthMetadata() when we need it? The proper solution should be to have https://phab.comm.dev/D10867#314643 implemented - but that is currently blocked. |