diff --git a/package.json b/package.json index a55af0ba..600c0d74 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@xpadev-net/niconicomments", - "version": "0.2.64", + "version": "0.2.65", "description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.", "main": "dist/bundle.js", "types": "dist/bundle.d.ts", diff --git a/src/comments/BaseComment.ts b/src/comments/BaseComment.ts index ee9c8fa7..8d0d4bfa 100755 --- a/src/comments/BaseComment.ts +++ b/src/comments/BaseComment.ts @@ -276,14 +276,14 @@ class BaseComment implements IComment { const cache = imageCache[this.cacheKey]; if (cache) { this.image = cache.image; - setTimeout( + window.setTimeout( () => { delete this.image; }, this.comment.long * 10 + config.cacheAge, ); clearTimeout(cache.timeout); - cache.timeout = setTimeout( + cache.timeout = window.setTimeout( () => { imageCache[this.cacheKey]?.image.destroy(); delete imageCache[this.cacheKey]; @@ -312,14 +312,14 @@ class BaseComment implements IComment { */ protected _cacheImage(image: IRenderer) { this.image = image; - setTimeout( + window.setTimeout( () => { delete this.image; }, this.comment.long * 10 + config.cacheAge, ); imageCache[this.cacheKey] = { - timeout: setTimeout( + timeout: window.setTimeout( () => { delete imageCache[this.cacheKey]; }, diff --git a/src/contexts/cache.ts b/src/contexts/cache.ts index 74735817..652b64ec 100755 --- a/src/contexts/cache.ts +++ b/src/contexts/cache.ts @@ -1,7 +1,7 @@ import type { IRenderer } from "@/@types/renderer"; let imageCache: { - [key: string]: { image: IRenderer; timeout: number | NodeJS.Timeout }; + [key: string]: { image: IRenderer; timeout: number }; } = {}; /**