Skip to content

Commit aec7ac7

Browse files
committed
Fix creating template
1 parent 6cb05be commit aec7ac7

File tree

1 file changed

+6
-2
lines changed
  • packages/app/src/app/overmind/namespaces/workspace

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,16 @@ export const addedTemplate: AsyncAction<{
282282

283283
try {
284284
const newTemplate = await effects.api.createTemplate(sandboxId, template);
285-
const sandbox = state.editor.sandboxes[sandboxId];
285+
const sandbox = state.editor.currentSandbox;
286286
sandbox.isFrozen = true;
287287
sandbox.customTemplate = newTemplate;
288288
actions.modalClosed();
289-
effects.notificationToast.success('Templated Created');
289+
effects.notificationToast.success('Successfully created the template');
290290
} catch (error) {
291+
if (process.env.NODE_ENV === 'development') {
292+
console.error(error);
293+
}
294+
291295
effects.notificationToast.error(
292296
'Could not create template, please try again later'
293297
);

0 commit comments

Comments
 (0)