🐛 优化脚本图标展示 #1052 by CodFrm · Pull Request #1104 · scriptscat/scriptcat
| {...rest} | ||
| > | ||
| {icon && !imageError ? ( | ||
| <img title={match} src={icon} onError={() => setImageError(true)} /> |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是在 fetchIcon 已经能知道是失败还是成功吗
不然怎储在OPFS?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
确实如此,可以删了这个逻辑
Comment on lines -228 to -233
| try { | ||
| const sessionBlobUrl = await cacheInstance.get<string>(`${CACHE_KEY_FAVICON}${filename}`); | ||
| if (sessionBlobUrl) return sessionBlobUrl; | ||
| } catch { | ||
| // 即使报错也不影响 | ||
| } |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cyfung1031 这里是运行在option页面上的,刷新option页面,会释放掉,这里用了缓存第二次会返回无效的链接
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
原來如此
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那就不cache每次都取opfs 做bloburl吧
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters