mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
fix file upload attachment api changes
This commit is contained in:
parent
0292725076
commit
41fb3e742e
@ -172,12 +172,14 @@ export class RoomViewModel extends ViewModel {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const attachment = this._room.uploadAttachment(file.blob, file.name);
|
|
||||||
const content = {
|
const content = {
|
||||||
body: file.name,
|
body: file.name,
|
||||||
msgtype: "m.file",
|
msgtype: "m.file"
|
||||||
};
|
};
|
||||||
await this._room.sendEvent("m.room.message", content, attachment);
|
await this._room.sendEvent("m.room.message", content, {
|
||||||
|
"url": this._room.createAttachment(file.blob, file.name)
|
||||||
|
});
|
||||||
|
// TODO: dispose file.blob (in the attachment, after upload)
|
||||||
}
|
}
|
||||||
|
|
||||||
get composerViewModel() {
|
get composerViewModel() {
|
||||||
|
Loading…
Reference in New Issue
Block a user