mirror of
https://github.com/thelounge/thelounge
synced 2024-11-29 07:20:25 +00:00
fix mentions
This commit is contained in:
parent
17ba07db3b
commit
9f2c82e152
1 changed files with 11 additions and 1 deletions
|
@ -1,7 +1,17 @@
|
||||||
import socket from "../socket";
|
import socket from "../socket";
|
||||||
import {store} from "../store";
|
import {store} from "../store";
|
||||||
import {ClientMention} from "../types";
|
import {ClientMention} from "../types";
|
||||||
|
import {SharedMention} from "../../../shared/types/mention";
|
||||||
|
|
||||||
socket.on("mentions:list", function (data) {
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue