-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Keep AudioContext object and add WILL_START dictate state (#2520)
* Keep AudioContext object and add WILL_START dictate state * Add entries
- Loading branch information
Showing
13 changed files
with
83 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
export default function createMicrophoneButtonStyle({ microphoneButtonColorOnDictate }) { | ||
return { | ||
// TODO: [P3] This path should not know anything about the DOM tree of <IconButton> | ||
'&.dictating > button svg': { | ||
fill: microphoneButtonColorOnDictate | ||
'&.dictating > button': { | ||
'&, &:focus, &:hover': { | ||
'& svg': { | ||
fill: microphoneButtonColorOnDictate | ||
} | ||
} | ||
} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
const IDLE = 0; | ||
const STARTING = 1; | ||
const DICTATING = 2; | ||
const STOPPING = 3; | ||
const WILL_START = 1; | ||
const STARTING = 2; | ||
const DICTATING = 3; | ||
const STOPPING = 4; | ||
|
||
export { DICTATING, IDLE, STARTING, STOPPING }; | ||
export { DICTATING, IDLE, STARTING, STOPPING, WILL_START }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/core/src/sagas/startDictateOnSpeakCompleteSaga.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { put, select, takeEvery } from 'redux-saga/effects'; | ||
|
||
import { MARK_ACTIVITY } from '../../lib/actions/markActivity'; | ||
import { of as activitiesOf } from '../selectors/activities'; | ||
import { SET_DICTATE_STATE } from '../../lib/actions/setDictateState'; | ||
import { WILL_START } from '../constants/DictateState'; | ||
import dictateStateSelector from '../selectors/dictateState'; | ||
import speakingActivity from '../definitions/speakingActivity'; | ||
import startDictate from '../actions/startDictate'; | ||
|
||
function* startDictateOnSpeakComplete() { | ||
const speakingActivities = yield select(activitiesOf(speakingActivity)); | ||
const dictateState = yield select(dictateStateSelector); | ||
|
||
if (dictateState === WILL_START && !speakingActivities.length) { | ||
yield put(startDictate()); | ||
} | ||
} | ||
|
||
// TODO: [P4] We should turn this into a reducer instead | ||
export default function* startDictateOnSpeakCompleteSaga() { | ||
yield takeEvery(({ type }) => type === MARK_ACTIVITY || type === SET_DICTATE_STATE, startDictateOnSpeakComplete); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default ({ dictateState }) => dictateState; |