mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 12:03:11 +00:00
17 lines
476 B
TypeScript
17 lines
476 B
TypeScript
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.map(sharedToClientMention));
|
|
});
|
|
|
|
function sharedToClientMention(shared: SharedMention): ClientMention {
|
|
const mention: ClientMention = {
|
|
...shared,
|
|
localetime: "", // TODO: can't be right
|
|
channel: null,
|
|
};
|
|
return mention;
|
|
}
|