fix mentions

This commit is contained in:
Reto Brunner 2024-04-14 00:52:16 +02:00
parent 17ba07db3b
commit 9f2c82e152

View file

@ -1,7 +1,17 @@
import socket from "../socket";
import {store} from "../store";
import {ClientMention} from "../types";
import {SharedMention} from "../../../shared/types/mention";
socket.on("mentions:list", function (data) {
store.commit("mentions", data as ClientMention[]);
store.commit("mentions", data.map(sharedToClientMention));
});
function sharedToClientMention(shared: SharedMention): ClientMention {
const mention: ClientMention = {
...shared,
localetime: "", // TODO: can't be right
channel: null,
};
return mention;
}