2017-06-26 09:01:55 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const $ = require("jquery");
|
2017-07-06 06:16:01 +00:00
|
|
|
const renderPreview = require("../renderPreview");
|
2017-06-26 09:01:55 +00:00
|
|
|
const socket = require("../socket");
|
2017-09-06 19:03:56 +00:00
|
|
|
const utils = require("../utils");
|
2017-06-26 09:01:55 +00:00
|
|
|
|
|
|
|
socket.on("msg:preview", function(data) {
|
2017-09-06 19:03:56 +00:00
|
|
|
// 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
|
|
|
});
|