2
0
Fork 0
mirror of https://github.com/thelounge/thelounge synced 2024-12-24 19:33:07 +00:00
thelounge/client/js/socket-events/msg_preview.js

12 lines
378 B
JavaScript
Raw Normal View History

2017-06-26 09:01:55 +00:00
"use strict";
const $ = require("jquery");
const renderPreview = require("../renderPreview");
2017-06-26 09:01:55 +00:00
const socket = require("../socket");
const utils = require("../utils");
2017-06-26 09:01:55 +00:00
socket.on("msg:preview", function(data) {
// Previews are not as important, we can wait longer for them to appear
utils.requestIdleCallback(() => renderPreview(data.preview, $("#msg-" + data.id)), 6000);
2017-06-26 09:01:55 +00:00
});