跳到主要内容

isWorkingTreeRestoreSessionEmpty()

function isWorkingTreeRestoreSessionEmpty(session): boolean;

Defined in: packages/rxdb-plugin-working-tree/src/working-tree/async-state.ts:288

restoreSession() 的空:当前分支没有未结束的恢复会话。

Parameters​

ParameterType
session| WorkingTreeRestoreSessionInfo | null

Returns​

boolean

Remarks​

判的是这一行在不在,不是它健不健康。按 status === 'active' 判的话,conflicted 的会话会在面板上凭空消失——而它仍占着 activeKey 的唯一索引、仍拦着下一次 restore、 仍要用户处理掉。「还成不成立」的唯一出口是 status() 的 restoring / conflicted 两位(见 status.ts),不在这里重算一遍。

一行 === null 也值得一个名字:三端各写一遍的话,迟早有一端写成上面那个版本, 于是同一个库在 Angular 上显示「恢复中」、在 Vue 上显示「没有恢复」。