Skip to content

Commit 4b47240

Browse files
committed
thank you typescript
1 parent 8d46bcf commit 4b47240

File tree

1 file changed

+3
-1
lines changed
  • packages/app/src/app/overmind/namespaces/profile

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ export const reorderFeaturedSandboxesInState: Action<{
305305

306306
// optimisic update
307307
const featuredSandboxes = [...state.profile.current.featuredSandboxes];
308-
const sandbox = featuredSandboxes.find((_, index) => index === startPosition);
308+
const sandbox = featuredSandboxes[startPosition]!;
309309

310310
// remove element first
311311
featuredSandboxes.splice(startPosition, 1);
@@ -320,6 +320,8 @@ export const saveFeaturedSandboxesOrder: AsyncAction = async ({
320320
effects,
321321
state,
322322
}) => {
323+
if (!state.profile.current) return;
324+
323325
try {
324326
const featuredSandboxIds = state.profile.current.featuredSandboxes.map(
325327
s => s.id

0 commit comments

Comments
 (0)