Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 7bac9e6

Browse files
authored
update browser-client version to set context id in switch context (#15)
update browser-client version to set context id in switch context
1 parent d4437a5 commit 7bac9e6

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

etc/react-client.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class SpeechProvider extends React_2.Component<SpeechProviderProps, Speec
7171
// (undocumented)
7272
readonly stopContext: () => Promise<void>;
7373
// (undocumented)
74-
readonly switchApp: (appId: string) => void;
74+
readonly switchApp: (appId: string) => Promise<void>;
7575
// (undocumented)
7676
readonly toggleRecording: () => Promise<void>;
7777
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@speechly/react-client",
3-
"version": "0.0.15",
3+
"version": "0.0.16",
44
"description": "React client for Speechly SLU API",
55
"private": true,
66
"keywords": [

src/context.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,11 @@ export class SpeechProvider extends React.Component<SpeechProviderProps, SpeechP
219219
return this.stopContext()
220220
}
221221

222-
readonly switchApp = (appId: string): void => {
222+
readonly switchApp = async (appId: string): Promise<void> => {
223223
const { client, clientState } = this.state
224224
this.setState({ appId })
225225
if (clientState === ClientState.Recording) {
226-
client.switchContext(appId)
226+
return client.switchContext(appId)
227227
}
228228
}
229229

@@ -245,7 +245,7 @@ export class SpeechProvider extends React.Component<SpeechProviderProps, SpeechP
245245
value={{
246246
initialise: this.initialiseAudio,
247247
toggleRecording: this.toggleRecording,
248-
switchApp: (appId: string) => this.switchApp(appId),
248+
switchApp: async(appId: string) => this.switchApp(appId),
249249
appId,
250250
speechState: recordingState,
251251
segment,

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,10 @@
138138
colors "~1.2.1"
139139
string-argv "~0.3.1"
140140

141-
"@speechly/browser-client@^1.0.10":
142-
version "1.0.10"
143-
resolved "https://registry.yarnpkg.com/@speechly/browser-client/-/browser-client-1.0.10.tgz#002c6a62aaf2c71e8c2003cd97aee1590bd9ac3e"
144-
integrity sha512-Bha4J3ibMNCyBClVZtrGt8t8sLoEXLRe6lTDFQVXbh60a9VmB8OGv3x3aKUUic7ANnMYqTcD3j9NUw2P6c1t0Q==
141+
"@speechly/browser-client@^1.0.11":
142+
version "1.0.11"
143+
resolved "https://registry.yarnpkg.com/@speechly/browser-client/-/browser-client-1.0.11.tgz#460648eff4dc021b3ecff01efdabc2b983cbd889"
144+
integrity sha512-R+YzeLMNZ3ALltVr6aplw6BE87+nujQ8780PcTFkT/dRIjqxbA2WAR3cE2kGTp5gV/5dHgEwS9K66wu1NucJKA==
145145
dependencies:
146146
async-retry "^1.3.1"
147147
base-64 "^0.1.0"

0 commit comments

Comments
 (0)