hardlounge/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
});