diff --git a/package.json b/package.json index bf0ce157..1e1a1a78 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "node": ">=14.6.0" }, "scripts": { - "start": "webpack serve --config ./webpack.dev.js", + "start": "webpack serve --config ./webpack.dev.js --open", "build": "webpack --config ./webpack.prod.js" }, "keywords": [], diff --git a/src/app/organisms/room/AttachmentUis/AttachmentFrame.jsx b/src/app/organisms/room/AttachmentUis/AttachmentFrame.jsx index 348106e7..7174162c 100644 --- a/src/app/organisms/room/AttachmentUis/AttachmentFrame.jsx +++ b/src/app/organisms/room/AttachmentUis/AttachmentFrame.jsx @@ -80,9 +80,9 @@ function AttachmentFrame({ } AttachmentFrame.propTypes = { - attachmentOrUi: PropTypes.node.isRequired, + attachmentOrUi: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired, fileSetter: PropTypes.func.isRequired, - uploadProgressRef: PropTypes.node.isRequired, + uploadProgressRef: PropTypes.shape().isRequired, cancelNeedle: PropTypes.func.isRequired, }; diff --git a/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.jsx b/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.jsx index bb5fc08f..8d3d5a07 100644 --- a/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.jsx +++ b/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.jsx @@ -45,6 +45,8 @@ function pauseRec() { } } function startOrResumeRec() { + if (!_mediaRecorder) return; + if (_mediaRecorder.state === 'paused') { _mediaRecorder.resume(); console.log('resume'); @@ -58,9 +60,8 @@ function restartRec() { if (_mediaRecorder.state !== 'inactive') _mediaRecorder.stop(); _mediaRecorder = null; - init(); - - startOrResumeRec(); + init() + .then(startOrResumeRec()); } // TODO: Handle turning off the recorder to remove the browser indicator @@ -106,7 +107,7 @@ function VoiceMailRecorder({ fnCancel, fnRequestResult, fnHowToSubmit }) {
-
+
{state} @@ -117,7 +118,7 @@ function VoiceMailRecorder({ fnCancel, fnRequestResult, fnHowToSubmit }) { ? (Pause) : (Start)} Reset - stopAndSubmit()} src={ChevronBottomIC} type="Add as attachment">Submit + stopAndSubmit()} src={ChevronBottomIC} tooltip="Add as attachment" type="submit">Submit
); diff --git a/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.scss b/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.scss index 295c315c..4d2abc9a 100644 --- a/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.scss +++ b/src/app/organisms/room/AttachmentUis/VoiceMailRecorder.scss @@ -1,6 +1,5 @@ -@use '../../../partials/flex'; -.room-attachment__info { +.room-attachment-ui-recorder { display: flex; div { diff --git a/src/app/organisms/room/RoomViewInput.jsx b/src/app/organisms/room/RoomViewInput.jsx index a9dade7c..22ef7202 100644 --- a/src/app/organisms/room/RoomViewInput.jsx +++ b/src/app/organisms/room/RoomViewInput.jsx @@ -328,7 +328,6 @@ function RoomViewInput({ <>
diff --git a/src/client/state/RoomsInput.js b/src/client/state/RoomsInput.js index b465ea5a..8a059968 100644 --- a/src/client/state/RoomsInput.js +++ b/src/client/state/RoomsInput.js @@ -216,7 +216,6 @@ class RoomsInput extends EventEmitter { } setAttachment(roomId, file) { - console.log(file); const input = this.getInput(roomId); input.attachment = { file, @@ -288,7 +287,6 @@ class RoomsInput extends EventEmitter { async sendFile(roomId, file) { const fileType = file.type.slice(0, file.type.indexOf('/')); - console.log(file.type); const info = { mimetype: file.type, size: file.size, @@ -408,7 +406,7 @@ class RoomsInput extends EventEmitter { // Apply formatting if relevant const formattedBody = formatAndEmojifyText( this.matrixClient.getRoom(roomId), - editedBody + editedBody, ); if (formattedBody !== editedBody) { content.formatted_body = ` * ${formattedBody}`;