fix: 打开时等后台就绪再显示已保存登录
This commit is contained in:
@@ -143,7 +143,7 @@ async def _merge(changes: list[tuple[str, str, dict | None]]) -> None:
|
||||
|
||||
|
||||
async def available_accounts() -> list[dict]:
|
||||
"""并发向平台确认每条凭证。失效的删掉,暂时连不上的留着但不显示。"""
|
||||
"""并发向平台确认每条凭证。确认失效的删掉,暂时连不上的仍显示本机保存的信息。"""
|
||||
items = _read()
|
||||
probed = await asyncio.gather(*(_probe(item) for item in items))
|
||||
changes: list[tuple[str, str, dict | None]] = []
|
||||
@@ -151,8 +151,9 @@ async def available_accounts() -> list[dict]:
|
||||
for item, (status, record) in zip(items, probed):
|
||||
login_id = str(item.get("loginId") or "")
|
||||
changes.append((login_id, status, record))
|
||||
if status == "ok" and record is not None:
|
||||
visible.append(public_view(record))
|
||||
if status == "drop":
|
||||
continue
|
||||
visible.append(public_view(record if status == "ok" and record is not None else item))
|
||||
await _merge(changes)
|
||||
return visible
|
||||
|
||||
|
||||
Reference in New Issue
Block a user