File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
packages/app/src/app/pages/Dashboard
Content/routes/DeletedSandboxes Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,15 @@ const DeletedSandboxes = () => (
3333 const orderedSandboxes = state . dashboard . getFilteredSandboxes (
3434 sandboxes
3535 ) ;
36- actions . dashboard . setTrashSandboxes ( {
37- sandboxIds : orderedSandboxes . map ( i => i . id ) ,
38- } ) ;
36+ const trashSandboxIds = orderedSandboxes . map ( i => i . id ) ;
37+ if (
38+ JSON . stringify ( state . dashboard . trashSandboxIds ) !==
39+ JSON . stringify ( trashSandboxIds )
40+ ) {
41+ actions . dashboard . setTrashSandboxes ( {
42+ sandboxIds : trashSandboxIds ,
43+ } ) ;
44+ }
3945
4046 return (
4147 < Sandboxes
Original file line number Diff line number Diff line change @@ -194,10 +194,9 @@ export const RENAME_SANDBOX_MUTATION = gql`
194194export const PERMANENTLY_DELETE_SANDBOXES_MUTATION = gql `
195195 mutation PermanentlyDeleteSandboxes($sandboxIds: [ID]!) {
196196 permanentlyDeleteSandboxes(sandboxIds: $sandboxIds) {
197- ...Sandbox
197+ id
198198 }
199199 }
200- ${ SANDBOX_FRAGMENT }
201200` ;
202201
203202export const PATHED_SANDBOXES_CONTENT_QUERY = gql `
@@ -311,16 +310,14 @@ export function undeleteSandboxes(selectedSandboxes) {
311310 } ) ;
312311}
313312
314- export function permanentlyDeleteSandboxes ( selectedSandboxes ) {
315- client . mutate <
313+ export function permanentlyDeleteSandboxes ( selectedSandboxes : string [ ] ) {
314+ return client . mutate <
316315 PermanentlyDeleteSandboxesMutation ,
317316 PermanentlyDeleteSandboxesMutationVariables
318317 > ( {
319318 mutation : PERMANENTLY_DELETE_SANDBOXES_MUTATION ,
320319 variables : {
321- sandboxIds : selectedSandboxes . toJS
322- ? selectedSandboxes . toJS ( )
323- : selectedSandboxes ,
320+ sandboxIds : selectedSandboxes ,
324321 } ,
325322 update : cache => {
326323 try {
@@ -335,12 +332,9 @@ export function permanentlyDeleteSandboxes(selectedSandboxes) {
335332 ...oldDeleteCache ,
336333 me : {
337334 ...( oldDeleteCache && oldDeleteCache . me ? oldDeleteCache . me : null ) ,
338- sandboxes : (
339- ( oldDeleteCache &&
340- oldDeleteCache . me &&
341- oldDeleteCache . me . sandboxes ) ||
342- ( [ ] as any )
343- ) . sandboxes . filter ( x => ! selectedSandboxes . includes ( x . id ) ) ,
335+ sandboxes : ( oldDeleteCache ?. me ?. sandboxes || [ ] ) . filter (
336+ x => ! selectedSandboxes . includes ( x . id )
337+ ) ,
344338 } ,
345339 } ;
346340
You can’t perform that action at this time.
0 commit comments