Skip to content

Commit 7853b4b

Browse files
review comment fixed
1 parent 2e275e6 commit 7853b4b

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

docs/CAPABILITIES.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Capabilities
22

3-
Web Chat supports dynamic capability discovery from adapters. Capabilities allow adapters to expose configuration values that WebChat components can consume and react to changes.
3+
Web Chat supports dynamic capability discovery from adapters. Capabilities allow adapters to expose configuration values that Web Chat components can consume and react to changes.
44

55
## Using the hook
66

@@ -22,9 +22,9 @@ if (voiceConfig) {
2222
2323
## Available capabilities
2424

25-
| Capability | Type | Description |
26-
|------------|------|-------------|
27-
| `voiceConfiguration` | `{ sampleRate: number, chunkIntervalMs: number }` | Audio settings for Speech-to-Speech |
25+
| Capability | Type | Description |
26+
| -------------------- | -------------------------------------------------- | ----------------------------------- |
27+
| `voiceConfiguration` | `{ chunkIntervalMs: number, sampleRate: number }` | Audio settings for Speech-to-Speech |
2828

2929
## How it works
3030

packages/api/src/providers/Capabilities/CapabilitiesComposer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ const CapabilitiesComposer = memo(({ children }: Props) => {
4646
[activities]
4747
);
4848

49+
// TODO: [P1] update to use EventTarget than activity$.
4950
const capabilities = useReduceMemo(
5051
activitiesWithInit,
5152
useCallback(

packages/api/src/providers/Capabilities/private/fetchCapabilitiesFromAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ export default function fetchCapabilitiesFromAdapter(
3737
const prevValue = prevCapabilities[key];
3838

3939
if (fetchedValue) {
40-
if (prevValue !== undefined && isEqual(prevValue, fetchedValue)) {
40+
if (typeof prevValue !== 'undefined' && isEqual(prevValue, fetchedValue)) {
4141
entries.push([key, prevValue]);
4242
} else {
4343
entries.push([key, Object.freeze({ ...fetchedValue })]);
4444
hasChanged = true;
4545
}
46-
} else if (prevValue !== undefined) {
46+
} else if (typeof prevValue !== 'undefined') {
4747
hasChanged = true;
4848
}
4949
} catch (error) {

packages/api/src/providers/Capabilities/private/shallowEqual.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { isForbiddenPropertyName } from 'botframework-webchat-core';
22

3+
// TODO: [P2] Move this file to `base` package.
34
export default function shallowEqual(x, y) {
45
if (x === y) {
56
return true;

packages/api/src/providers/Capabilities/types/Capabilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ type Capabilities = Readonly<{
99
* Optional for adapter/server to provide these configs for speech-to-speech.
1010
*/
1111
type VoiceConfiguration = Readonly<{
12-
sampleRate: number;
1312
chunkIntervalMs: number;
13+
sampleRate: number;
1414
}>;
1515

1616
export type { Capabilities, VoiceConfiguration };

0 commit comments

Comments
 (0)