From 6480d62a1bb30b9f9ef218977edbe028f89e0624 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Wed, 27 Apr 2022 12:31:51 +0100 Subject: [PATCH] Fix issue sorting screens with custom roles --- .../design/screens/_components/ScreenNavigationPanel.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/screens/_components/ScreenNavigationPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/screens/_components/ScreenNavigationPanel.svelte index e172012bdd..babaea427a 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/screens/_components/ScreenNavigationPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/screens/_components/ScreenNavigationPanel.svelte @@ -28,8 +28,8 @@ .slice() .sort((a, b) => { // Sort by role first - const roleA = RolePriorities[a.routing.roleId] - const roleB = RolePriorities[b.routing.roleId] + const roleA = RolePriorities[a.routing.roleId] ?? 0 + const roleB = RolePriorities[b.routing.roleId] ?? 0 if (roleA !== roleB) { return roleA > roleB ? -1 : 1 }