Skip to content

Commit

Permalink
feat: Inject CozyClient in Bar ✨
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorylegarec committed Mar 27, 2019
1 parent a998a61 commit 105d72f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ducks/mobile/MobileRouter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const withAuth = Wrapped => {
this.onAuthentication()
const url = this.props.url
setURLContext(url)
initBar(url, this.props.accessToken, {
initBar(this.props.client, url, this.props.accessToken, {
onLogOut: this.onLogout
})
}
Expand Down
3 changes: 2 additions & 1 deletion src/ducks/mobile/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ export async function resetClient(cozyClient) {
}
}

export const initBar = (url, accessToken, options = {}) => {
export const initBar = (client, url, accessToken, options = {}) => {
cozy.bar.init({
appNamePrefix: 'Cozy',
appName: 'Banks',
appEditor: 'Cozy',
appSlug: 'banks',
cozyClient: client,
cozyURL: url,
token: accessToken,
iconPath: require('targets/favicons/icon-banks.svg'),
Expand Down
1 change: 1 addition & 0 deletions src/main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const setupApp = async persistedState => {
if (__TARGET__ !== 'mobile') {
cozy.bar.init({
appName: data.cozyAppName,
cozyClient: client,
iconPath: data.cozyIconPath,
lang: data.cozyLocale,
replaceTitleOnMobile: true
Expand Down

0 comments on commit 105d72f

Please sign in to comment.