diff --git a/package.json b/package.json index cf936e57..9a8684a6 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "remark-math": "^5.1.1", "remark-parse": "^10.0.1", "remark-rehype": "^10.1.0", - "revolt.js": "6.0.12", + "revolt.js": "6.0.13", "rimraf": "^3.0.2", "sass": "^1.35.1", "semver": "^7.3.7", diff --git a/src/lib/renderer/Singleton.ts b/src/lib/renderer/Singleton.ts index b59e7a4c..90c4d20d 100644 --- a/src/lib/renderer/Singleton.ts +++ b/src/lib/renderer/Singleton.ts @@ -34,19 +34,19 @@ export class ChannelRenderer { }); this.receive = this.receive.bind(this); - this.edit = this.edit.bind(this); + this.updated = this.updated.bind(this); this.delete = this.delete.bind(this); const client = this.channel.client; client.addListener("message", this.receive); - client.addListener("message/update", this.edit); + client.addListener("message/updated", this.updated); client.addListener("message/delete", this.delete); } destroy() { const client = this.channel.client; client.removeListener("message", this.receive); - client.removeListener("message/update", this.edit); + client.removeListener("message/updated", this.updated); client.removeListener("message/delete", this.delete); } @@ -54,8 +54,8 @@ export class ChannelRenderer { this.currentRenderer.receive(this, message); } - private edit(id: string, patch: Partial) { - this.currentRenderer.edit(this, id, patch); + private updated(id: string, message: Message) { + this.currentRenderer.updated(this, id, message); } private delete(id: string) { diff --git a/src/lib/renderer/simple/SimpleRenderer.ts b/src/lib/renderer/simple/SimpleRenderer.ts index cd7d2b81..98db77b6 100644 --- a/src/lib/renderer/simple/SimpleRenderer.ts +++ b/src/lib/renderer/simple/SimpleRenderer.ts @@ -1,6 +1,5 @@ import { runInAction } from "mobx"; -import { noopAsync } from "../../js"; import { SMOOTH_SCROLL_ON_RECEIVE } from "../Singleton"; import { RendererRoutines } from "../types"; @@ -72,7 +71,7 @@ export const SimpleRenderer: RendererRoutines = { }); }); }, - edit: async (renderer) => { + updated: async (renderer) => { renderer.emitScroll({ type: "StayAtBottom", smooth: false, diff --git a/src/lib/renderer/types.ts b/src/lib/renderer/types.ts index 3f2c477a..8c625629 100644 --- a/src/lib/renderer/types.ts +++ b/src/lib/renderer/types.ts @@ -29,10 +29,10 @@ export interface RendererRoutines { ) => Promise; receive: (renderer: ChannelRenderer, message: Message) => Promise; - edit: ( + updated: ( renderer: ChannelRenderer, id: string, - partial: Partial, + message: Message, ) => Promise; delete: (renderer: ChannelRenderer, id: string) => Promise; diff --git a/yarn.lock b/yarn.lock index 1b3ac129..45e1b51b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3696,7 +3696,7 @@ __metadata: remark-math: ^5.1.1 remark-parse: ^10.0.1 remark-rehype: ^10.1.0 - revolt.js: 6.0.12 + revolt.js: 6.0.13 rimraf: ^3.0.2 sass: ^1.35.1 semver: ^7.3.7 @@ -7890,9 +7890,9 @@ __metadata: languageName: node linkType: hard -"revolt.js@npm:6.0.12": - version: 6.0.12 - resolution: "revolt.js@npm:6.0.12" +"revolt.js@npm:6.0.13": + version: 6.0.13 + resolution: "revolt.js@npm:6.0.13" dependencies: "@insertish/exponential-backoff": 3.1.0-patch.2 "@insertish/isomorphic-ws": ^4.0.1 @@ -7906,7 +7906,7 @@ __metadata: revolt-api: 0.5.5 ulid: ^2.3.0 ws: ^8.2.2 - checksum: 1ff667daf3e7c9b32ee383d56f79db9d5112b1ca87eb406c749fa3ce5f8adb59cd48ec3cb935932a5cc5da0af6f82e2dd7b5b83fa0705e02f66c050bc848401a + checksum: 15fae99ced07c93942122bcc190bb03c62bf6c9bb90ca35aec5c1ed12f547e1dad7b596c549784ba8bf38ebbb96e62af195305ec92ec9fadf69969a1681b8e23 languageName: node linkType: hard