fix(workspace): avoid data loss (hot-fix) (#6114)

This commit is contained in:
EYHN
2024-03-14 13:14:03 +08:00
committed by GitHub
parent 39476d16ef
commit cccea3ec3e
2 changed files with 10 additions and 0 deletions
@@ -13,6 +13,9 @@ export function fixWorkspaceVersion(rootDoc: YDoc) {
* Blocksuite just set the value, do nothing else.
*/
function doFix() {
if (meta.size === 0) {
return;
}
const workspaceVersion = meta.get('workspaceVersion');
if (typeof workspaceVersion !== 'number' || workspaceVersion < 2) {
transact(