2022-06-19 00:25:21 +00:00
|
|
|
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";
|
2022-06-19 00:25:21 +00:00
|
|
|
|
|
|
|
socket.on("mentions:list", function (data) {
|
2024-04-13 22:52:16 +00:00
|
|
|
store.commit("mentions", data.map(sharedToClientMention));
|
2022-06-19 00:25:21 +00:00
|
|
|
});
|
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;
|
|
|
|
}
|