Skip to content

Commit edbf16f

Browse files
fix(dashboard): support filtering deleted sandboxes with reduced field set
1 parent c12116f commit edbf16f

File tree

1 file changed

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

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export type State = {
4848
viewMode: 'grid' | 'list';
4949
orderBy: OrderBy;
5050
getFilteredSandboxes: (
51-
sandboxes: Array<Sandbox | Repo | Template['sandbox']>
51+
sandboxes: Array<Sandbox | RecentlyDeletedTeamSandboxesFragment | Repo | Template['sandbox']>
5252
) => Sandbox[];
5353
deletedSandboxesByTime: {
5454
week: RecentlyDeletedTeamSandboxesFragment[];
@@ -137,7 +137,7 @@ export const state: State = {
137137
},
138138
getFilteredSandboxes: derived(
139139
({ orderBy }: State) => (
140-
sandboxes: Array<Sandbox | Template['sandbox']>
140+
sandboxes: Array<Sandbox | RecentlyDeletedTeamSandboxesFragment | Template['sandbox']>
141141
) => {
142142
const orderField = orderBy.field;
143143
const orderOrder = orderBy.order;
@@ -156,7 +156,7 @@ export const state: State = {
156156
return field.toLowerCase();
157157
}
158158

159-
if (orderField === 'views') {
159+
if ('viewCount' in sandbox && orderField === 'views') {
160160
return sandbox.viewCount;
161161
}
162162

0 commit comments

Comments
 (0)