Skip to content

Commit

Permalink
feat: add me interaction triggers to dataContainer
Browse files Browse the repository at this point in the history
- add onUser trigger
- add onNoUser trigger
- add onUserLoading
  • Loading branch information
gareth.loot committed Oct 10, 2020
1 parent 6b239e1 commit a6cbc1d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/dataContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,20 @@
if (authProfile) {
return (
<B.GetMe authenticationProfileId={authProfile}>
{canvasLayout()}
{({ loading, error, data }) => {
if (loading) {
B.triggerEvent('onUserLoading');
}
if (error) {
B.triggerEvent('onNoUser', error.message);
}

if (data && data.id) {
B.triggerEvent('onUser', data);
}

return canvasLayout();
}}
</B.GetMe>
);
}
Expand Down

0 comments on commit a6cbc1d

Please sign in to comment.