🐛 (shelf): 微信书架待导入快照只弹一次导入页,普通刷新不再重复弹窗
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
1 parent
d77606c6f8
commit
b4ff3791f1
4 files changed
+22
-1
No files matched your search
@@ -1569,6 +1569,17 @@ do
|
||||
Assert.is_true(reopen_pending, "手动强制刷新重新打开已有导入页")
|
||||
Assert.eq(err, "pending import")
|
||||
|
||||
-- 后台同步先把快照存盘,之后普通手动刷新(非长按强刷)也必须弹出导入页
|
||||
local opened = 0
|
||||
require("utils.extension").add("web.open_page", function() opened = opened + 1 end)
|
||||
src:syncBooksAsync({ manual = true }, function(r, e) result, err = r, e end)
|
||||
require("support.stubs").flush()
|
||||
Assert.eq(opened, 1, "普通手动刷新遇到没弹过的待导入快照要弹一次")
|
||||
Assert.is_true(result.skipped)
|
||||
src:syncBooksAsync({ manual = true }, function(r, e) result, err = r, e end)
|
||||
require("support.stubs").flush()
|
||||
Assert.eq(opened, 1, "同一份快照只弹一次,之后的普通刷新不再弹")
|
||||
|
||||
fake_client.shelfSyncIdsAsync, fake_client.shelfSyncAsync = nil, nil
|
||||
package.loaded["moonsource_weread.shelf_import"] = saved_import
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user