Skip to content

Commit 7a22a1b

Browse files
authored
set sandboxes to empty array when catching errors (#7035)
1 parent 0136efc commit 7a22a1b

File tree

1 file changed

+3
-2
lines changed
  • packages/app/src/app/overmind/namespaces/dashboard

1 file changed

+3
-2
lines changed

packages/app/src/app/overmind/namespaces/dashboard/actions.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ export const getTemplateSandboxes = async ({ state, effects }: Context) => {
564564

565565
export const getStartPageSandboxes = async ({ state, effects }: Context) => {
566566
const { dashboard } = state;
567+
567568
try {
568569
/**
569570
* For now we decided to NOT show the templates on the home page
@@ -573,11 +574,9 @@ export const getStartPageSandboxes = async ({ state, effects }: Context) => {
573574
const usedTemplates = await effects.gql.queries.listPersonalTemplates({
574575
teamId: state.activeTeam,
575576
});
576-
577577
if (!usedTemplates || !usedTemplates.me) {
578578
return;
579579
}
580-
581580
dashboard.sandboxes.TEMPLATE_HOME = usedTemplates.me.recentlyUsedTemplates.slice(
582581
0,
583582
5
@@ -601,6 +600,8 @@ export const getStartPageSandboxes = async ({ state, effects }: Context) => {
601600
dashboard.sandboxes.RECENT_BRANCHES =
602601
branchesResult?.me?.recentBranches || [];
603602
} catch (error) {
603+
dashboard.sandboxes.RECENT_SANDBOXES = [];
604+
dashboard.sandboxes.RECENT_BRANCHES = [];
604605
effects.notificationToast.error(
605606
'There was a problem getting your sandboxes'
606607
);

0 commit comments

Comments
 (0)