thelounge/client/js/socket-events/mentions.ts

18 lines
476 B
TypeScript
Raw Normal View History

import socket from "../socket";
import {store} from "../store";
import {ClientMention} from "../types";
2024-04-13 22:52:16 +00:00
import {SharedMention} from "../../../shared/types/mention";
socket.on("mentions:list", function (data) {
2024-04-13 22:52:16 +00:00
store.commit("mentions", data.map(sharedToClientMention));
});
2024-04-13 22:52:16 +00:00
function sharedToClientMention(shared: SharedMention): ClientMention {
const mention: ClientMention = {
...shared,
localetime: "", // TODO: can't be right
channel: null,
};
return mention;
}