Skip to content

Commit f0d264b

Browse files
authored
Fix some type errors (#5503)
1 parent 1a2a93c commit f0d264b

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

packages/frontend/src/components/AudioRecorder/AudioRecorder.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export const AudioRecorder = ({
154154
?.stop()
155155
.getMp3()
156156
.then(([buffer, _blob]) => {
157-
saveVoiceAsDraft(new Blob(buffer, { type: 'audio/mp3' }))
157+
saveVoiceAsDraft(new Blob(buffer as any, { type: 'audio/mp3' }))
158158
})
159159
.catch((err: any) => {
160160
onError(new AudioRecorderError(err.message))

packages/frontend/src/components/AudioRecorder/Encoder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class Encoder {
4848

4949
/**
5050
* Append new audio buffer to current active buffer
51-
* @param {ArrayBuffer | Int8Array} buffer
51+
* @param {ArrayBuffer | Int8Array | Uint8Array} buffer
5252
*/
53-
appendToBuffer(buffer: ArrayBuffer | Int8Array): void {
53+
appendToBuffer(buffer: ArrayBuffer | Int8Array | Uint8Array): void {
5454
this.dataBuffer.push(new Int8Array(buffer))
5555
}
5656

packages/frontend/src/components/AudioRecorder/MicRecorder.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ class MicRecorder {
154154
if (finalBuffer.length === 0) {
155155
reject(new Error('No buffer to send'))
156156
} else {
157-
resolve([finalBuffer, new Blob(finalBuffer, { type: 'audio/mp3' })])
157+
resolve([
158+
finalBuffer,
159+
new Blob(
160+
finalBuffer.map(buffer => new Uint8Array(buffer)),
161+
{ type: 'audio/mp3' }
162+
),
163+
])
158164
this.lameEncoder?.clearBuffer()
159165
}
160166
})

packages/frontend/src/components/message/MessageMetaData.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,15 @@ export default function MessageMetaData(props: Props) {
113113
<span className='visually-hidden'>
114114
{tx(
115115
`a11y_delivery_status_${
116-
status as Exclude<
117-
typeof status,
118-
// '' is not supposed to happen.
119-
// The others are not supposed to happen
120-
// as long as direction is outgoing.
121-
| ''
122-
| (typeof direction extends 'outgoing'
123-
? 'in_fresh' | 'in_seen' | 'in_noticed'
124-
: never)
125-
>
116+
error !== null
117+
? 'error'
118+
: (status as Exclude<
119+
typeof status,
120+
// '' is not supposed to happen.
121+
// The others are not supposed to happen
122+
// as long as direction is outgoing.
123+
'' | 'in_fresh' | 'in_seen' | 'in_noticed'
124+
>)
126125
}`
127126
)}
128127
</span>

packages/frontend/src/stockStrings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export async function updateCoreStrings() {
2020
strings[C.DC_STR_VIDEO] = tx('video')
2121
strings[C.DC_STR_AUDIO] = tx('audio')
2222
strings[C.DC_STR_FILE] = tx('file')
23-
strings[C.DC_STR_ENCRYPTEDMSG] = tx('encrypted_message')
2423
// strings[C.DC_STR_E2E_AVAILABLE] = tx('DC_STR_E2E_AVAILABLE')
2524
// strings[C.DC_STR_ENCR_TRANSP] = tx('DC_STR_ENCR_TRANSP')
2625
// strings[C.DC_STR_ENCR_NONE] = tx('DC_STR_ENCR_NONE')
@@ -81,7 +80,6 @@ export async function updateCoreStrings() {
8180
strings[C.DC_STR_SETUP_CONTACT_QR_DESC] = tx('qrshow_join_contact_hint')
8281
strings[C.DC_STR_SECURE_JOIN_GROUP_QR_DESC] = tx('qrshow_join_group_hint')
8382
strings[C.DC_STR_NOT_CONNECTED] = tx('connectivity_not_connected')
84-
strings[C.DC_STR_AEAP_EXPLANATION_AND_LINK] = tx('aeap_explanation')
8583
strings[C.DC_STR_GROUP_NAME_CHANGED_BY_YOU] = tx('group_name_changed_by_you')
8684
strings[C.DC_STR_GROUP_NAME_CHANGED_BY_OTHER] = tx(
8785
'group_name_changed_by_other'

packages/target-electron/src/deltachat/webxdc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -894,7 +894,7 @@ async function webxdcProtocolHandler(
894894

895895
if (filename === WRAPPER_PATH) {
896896
return makeResponse(
897-
await readFile(join(htmlDistDir(), '/webxdc_wrapper.html')),
897+
await readFile(join(htmlDistDir(), '/webxdc_wrapper.html'), 'utf8'),
898898
{},
899899
mimeType
900900
)

0 commit comments

Comments
 (0)