Merged
Conversation
Collaborator
|
還沒看 不然改完一次又要重新改 (我指popup資料保存/殘留的部份) |
Collaborator
|
所以問題是react沒正確繪畫,還是pageload那個儲存更新的問題呀? |
Member
Author
cyfung1031
reviewed
Dec 21, 2025
Comment on lines
+207
to
+233
| public getRecord(keys: string[]): Promise<Partial<Record<string, T>>> { | ||
| keys = keys.map((key) => this.joinKey(key)); | ||
| if (this.useCache) { | ||
| return loadCache().then((cache) => { | ||
| const record: Partial<Record<string, T>> = {}; | ||
| for (const key of keys) { | ||
| if (cache[key]) { | ||
| record[key] = Object.assign({}, cache[key]); | ||
| } else { | ||
| record[key] = cache[key]; | ||
| } | ||
| } | ||
| return record; | ||
| }); | ||
| } | ||
| return new Promise((resolve) => { | ||
| chrome.storage.local.get(keys, (result) => { | ||
| const lastError = chrome.runtime.lastError; | ||
| if (lastError) { | ||
| console.error("chrome.runtime.lastError in chrome.storage.local.get:", lastError); | ||
| // 无视storage API错误,继续执行 | ||
| } | ||
| resolve(result as Partial<Record<string, T>>); | ||
| }); | ||
| }); | ||
| } | ||
|
|
Member
Author
There was a problem hiding this comment.
改了写法后没用了,不过觉得以后还是需要这种操作,就留下来了
Collaborator
Collaborator
我记得是 vivaldi 或是什么浏览器,你打开了 popup 后,关掉再开还是同一个画面 所以关了popup 切换语言 后,React没乱跑重绘的话,显示不会切换到新语言 |
Collaborator
不用倒回去 這樣就修好了 |
Collaborator
|
我已经修正了问题 真的修React的烂问题很烦。不要随便动这些写好的React状态处理方式 每次你改完又出一堆问题又要改回去,很麻烦 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

概述 Descriptions
修改了normalScriptCounts、backScriptCounts计数逻辑,不需要去分两个memo ,修复总数至少会为1的问题
删除了 scriptDataAsyncCounter,在useEffect中可以判断
删除了 extraData.lang , 在 popup 页面打开的情况下,不可能切换语言 (暂时未动)
这个 extraData 的逻辑。。。。真的绕,打开popup的script会更新的情况应该是很少数,为了很少数的情况做这个处理也是一种性能浪费,而且存在bug,暂时没排查出来不过大概是这一块的原因,
今天先没时间了,想改成其它的逻辑了,还是改了,睡觉先有时候列表显示全是空,但是实际上是有数据的 (2/6) (1/1):
变更内容 Changes
截图 Screenshots