Commit 328ddbcd by 吴云建

fix

parent 81d6a8d0
Showing with 3 additions and 3 deletions
...@@ -50,7 +50,7 @@ async function preCacheImgs(msgs: any[]) { ...@@ -50,7 +50,7 @@ async function preCacheImgs(msgs: any[]) {
if (!isAccessibleUrl(url)) { if (!isAccessibleUrl(url)) {
resolve(); resolve();
} }
if (url && isAccessibleUrl(url)) { if (url && isAccessibleUrl(url) && typeof Image !== "undefined") {
const preCache = new Image(); const preCache = new Image();
preCache.src = url; preCache.src = url;
preCache.onload = () => resolve(); preCache.onload = () => resolve();
...@@ -270,11 +270,11 @@ export default { ...@@ -270,11 +270,11 @@ export default {
const eid = payload.eid; const eid = payload.eid;
if (eid === state[ChatStore.STATE_CHAT_MY_ID]) return; if (eid === state[ChatStore.STATE_CHAT_MY_ID]) return;
if (arr.includes(eid)) { if (arr.includes(eid)) {
window.clearTimeout(setTimeoutId[eid]); clearTimeout(setTimeoutId[eid]);
} else { } else {
arr.push(eid); arr.push(eid);
} }
setTimeoutId[eid] = window.setTimeout(() => { setTimeoutId[eid] = setTimeout(() => {
arr.splice(arr.indexOf(eid), 1); arr.splice(arr.indexOf(eid), 1);
}, 4000); }, 4000);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment