Bump matrix-js-sdk from 20.1.0 to 21.0.1 (#959)

* Bump matrix-js-sdk from 20.1.0 to 21.0.0

Bumps [matrix-js-sdk](https://github.com/matrix-org/matrix-js-sdk) from 20.1.0 to 21.0.0.
- [Release notes](https://github.com/matrix-org/matrix-js-sdk/releases)
- [Changelog](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/matrix-org/matrix-js-sdk/compare/v20.1.0...v21.0.0)

---
updated-dependencies:
- dependency-name: matrix-js-sdk
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump matrix-js-sdk from 20.1.0 to 21.0.1

Bumps [matrix-js-sdk](https://github.com/matrix-org/matrix-js-sdk) from 20.1.0 to 21.0.1.
- [Release notes](https://github.com/matrix-org/matrix-js-sdk/releases)
- [Changelog](https://github.com/matrix-org/matrix-js-sdk/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/matrix-org/matrix-js-sdk/compare/v20.1.0...v21.0.1)

---
updated-dependencies:
- dependency-name: matrix-js-sdk
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix upload content

* Change min supported node

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ajay Bura <32841439+ajbura@users.noreply.github.com>
This commit is contained in:
dependabot[bot] 2022-11-08 20:19:22 +05:30 committed by GitHub
parent 856e616247
commit 62e0821be2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 45 additions and 645 deletions

677
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -4,8 +4,7 @@
"description": "Yet another matrix client", "description": "Yet another matrix client",
"main": "index.js", "main": "index.js",
"engines": { "engines": {
"npm": ">=6.14.8", "node": ">=16.0.0"
"node": ">=14.15.0"
}, },
"scripts": { "scripts": {
"start": "webpack serve --config ./webpack.dev.js --open", "start": "webpack serve --config ./webpack.dev.js --open",
@ -32,7 +31,7 @@
"katex": "0.16.3", "katex": "0.16.3",
"linkify-html": "4.0.2", "linkify-html": "4.0.2",
"linkifyjs": "4.0.2", "linkifyjs": "4.0.2",
"matrix-js-sdk": "20.1.0", "matrix-js-sdk": "21.0.1",
"prop-types": "15.8.1", "prop-types": "15.8.1",
"react": "17.0.2", "react": "17.0.2",
"react-autosize-textarea": "7.1.0", "react-autosize-textarea": "7.1.0",

View file

@ -27,9 +27,7 @@ function ImagePackUpload({ onUpload }) {
setProgress(true); setProgress(true);
const image = await scaleDownImage(imgFile, 512, 512); const image = await scaleDownImage(imgFile, 512, 512);
const url = await mx.uploadContent(image, { const { content_uri: url } = await mx.uploadContent(image);
onlyContentUri: true,
});
onUpload(shortcode, url); onUpload(shortcode, url);
setProgress(false); setProgress(false);

View file

@ -22,7 +22,7 @@ function ImageUpload({
const file = e.target.files.item(0); const file = e.target.files.item(0);
if (file === null) return; if (file === null) return;
try { try {
const uPromise = initMatrix.matrixClient.uploadContent(file, { onlyContentUri: false }); const uPromise = initMatrix.matrixClient.uploadContent(file);
setUploadPromise(uPromise); setUploadPromise(uPromise);
const res = await uPromise; const res = await uPromise;

View file

@ -395,7 +395,7 @@ class RoomsInput extends EventEmitter {
input.attachment.uploadingPromise = uploadingPromise; input.attachment.uploadingPromise = uploadingPromise;
this.roomIdToInput.set(roomId, input); this.roomIdToInput.set(roomId, input);
const url = await uploadingPromise; const { content_uri: url } = await uploadingPromise;
delete input.attachment.uploadingPromise; delete input.attachment.uploadingPromise;
this.roomIdToInput.set(roomId, input); this.roomIdToInput.set(roomId, input);