Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getClient = () => {
if (client) {
return client
}
client = lib.getClient()
const intents = new Intents({ client })
client.intents = intents
client.registerPlugin(RealtimePlugin)
// Used as a hack to prevent circular dependency.
// Some selectors need to access cozyClient to correctly hydrate.
// That should change, hydratation should be possible to do only
// with the store
// See selectors/index.js
window.cozyClient = client
return client
}
const fetch = async () => {
const intents = new Intents({ client: client })
const redirectionURL = await intents.getRedirectionURL(doctype, options)
setRedirectionURL(redirectionURL)
}
fetch()
constructor(props, context) {
super(props, context)
this.intents = new Intents({ client: props.client })
}