Unblock subsequent Singleton.createInstance() (#3225)

- Also fix clusters with unknown workspaces

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-07-06 17:16:04 +03:00
1 parent c4623c424d
commit 803c3a3d34
3 files changed
+15 -5

No files matched your search

+3 -1
View File
@@ -44,8 +44,10 @@ export function joinMigrations(...declarations: MigrationDeclaration[]): Migrati
return Object.fromEntries(
iter.map(
migrations,
migrations,
([v, fns]) => [v, (store: Conf<any>) => {
migrationLog(`Running ${v} migration for ${store.path}`);
for (const fn of fns) {
fn(store);
}
@@ -75,6 +75,11 @@ export default {
for (const workspaceId of cluster.workspaces ?? [cluster.workspace].filter(Boolean)) {
const workspaceHotbar = workspaceHotbars.get(workspaceId);
if (!workspaceHotbar) {
migrationLog(`Cluster ${uid} has unknown workspace ID, skipping`);
continue;
}
migrationLog(`Adding cluster ${uid} to ${workspaceHotbar.name}`);
if (workspaceHotbar?.items.length < defaultHotbarCells) {