Skip to content

Commit

Permalink
Merge pull request #94 from Holo-Host/enable-saving-client-to-window-…
Browse files Browse the repository at this point in the history
…12-04

Enable adding client to window
  • Loading branch information
robbiecarlton authored Apr 12, 2024
2 parents e09a5f1 + d572003 commit 2ae5248
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/stores/useHoloStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useSignalStore from './useSignalStore'

let client

const makeUseHoloStore = ({ connectionArgs, MockWebSdk }) => defineStore('holo', {
const makeUseHoloStore = ({ connectionArgs, MockWebSdk, addClientToWindow }) => defineStore('holo', {
state: () => ({
agentState: {},
happId: null,
Expand All @@ -32,6 +32,10 @@ const makeUseHoloStore = ({ connectionArgs, MockWebSdk }) => defineStore('holo',
} else {
client = await WebSdk.connect(connectionArgs)
}

if (addClientToWindow) {
window.envoy = client
}
} catch (e) {
throw e
}
Expand Down

0 comments on commit 2ae5248

Please sign in to comment.