Skip to content

Commit 1ca3f07

Browse files
committed
UI bug fixes
1 parent 9554576 commit 1ca3f07

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/components/calibrate/AudioRecord.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export default function AudioRecord() {
7272
const [state, setState] = useState<AudioState>(AudioState.Ready);
7373
const [recorder, setRecorder] = useState<MediaRecorder>();
7474
const [feedbackMsg, setFeedbackMsg] = useState<string | null>();
75-
const { deviceId } = useAppSelector(selectCalibrate);
75+
const { deviceId, testName } = useAppSelector(selectCalibrate);
7676
const dispatch = useAppDispatch();
7777

7878
useEffect(() => {
@@ -82,7 +82,7 @@ export default function AudioRecord() {
8282
console.log(status);
8383
if (status === true) {
8484
setState(AudioState.Finished);
85-
setFeedbackMsg(message);
85+
//setFeedbackMsg(message);
8686
writeSerial(data).then((serialStatus) => {
8787
console.log(serialStatus);
8888
});
@@ -174,7 +174,7 @@ export default function AudioRecord() {
174174

175175
const getStateMessage = (): string | null => {
176176
if (state === AudioState.Ready) {
177-
return "Start the test for the listed recording device.";
177+
return `Start the ${testName} test for the listed recording device.`;
178178
} else if (state === AudioState.Processing) {
179179
return "Processing...";
180180
} else if (state === AudioState.Recording) {

src/css/Media.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
min-height: 50px;
4444
font-size: 25px;
4545
padding-bottom: 20px;
46+
word-break: break-word;
4647
}
4748

4849
.media-player {

src/reducers/calibrateSlice.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ import { Calibrate } from "enums/calibrate";
55
interface CalibrateState {
66
currentState: Calibrate;
77
deviceId: string | null;
8+
testName: string | null;
89
}
910

1011
const initialState: CalibrateState = {
1112
currentState: Calibrate.deviceConfig,
1213
deviceId: null,
14+
testName: null,
1315
};
1416

1517
export const calibrateSlice = createSlice({
@@ -28,6 +30,7 @@ export const calibrateSlice = createSlice({
2830
}
2931
case Calibrate.prompt1: {
3032
state.currentState = Calibrate.audioTest1;
33+
state.testName = "Ambient Noise";
3134
break;
3235
}
3336
case Calibrate.audioTest1: {

0 commit comments

Comments
 (0)