From e057d717c176271da18ccc0507768f34b57f9910 Mon Sep 17 00:00:00 2001 From: Sai Jatin K Date: Tue, 23 Jun 2020 22:11:10 +0530 Subject: [PATCH 1/2] feature show toast for project save failure #1393 --- client/modules/IDE/actions/project.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index 2e2bca0b..7764f28d 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -167,6 +167,8 @@ export function saveProject(selectedFile = null, autosave = false) { .catch((error) => { const { response } = error; dispatch(endSavingProject()); + dispatch(setToastText('Failed to save project.')); + dispatch(showToast(1500)); if (response.status === 403) { dispatch(showErrorModal('staleSession')); } else if (response.status === 409) { @@ -207,6 +209,8 @@ export function saveProject(selectedFile = null, autosave = false) { .catch((error) => { const { response } = error; dispatch(endSavingProject()); + dispatch(setToastText('Failed to save project.')); + dispatch(showToast(1500)); if (response.status === 403) { dispatch(showErrorModal('staleSession')); } else { From a20971bd950ed6d1af0b5ac4459d2b86cc29de89 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 29 Jun 2020 17:06:03 -0400 Subject: [PATCH 2/2] [#1393] Change "project" to "sketch" in toast --- client/modules/IDE/actions/project.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client/modules/IDE/actions/project.js b/client/modules/IDE/actions/project.js index 7764f28d..9055d484 100644 --- a/client/modules/IDE/actions/project.js +++ b/client/modules/IDE/actions/project.js @@ -155,19 +155,19 @@ export function saveProject(selectedFile = null, autosave = false) { if (!autosave) { if (state.ide.justOpenedProject && state.preferences.autosave) { dispatch(showToast(5500)); - dispatch(setToastText('Project saved.')); + dispatch(setToastText('Sketch saved.')); setTimeout(() => dispatch(setToastText('Autosave enabled.')), 1500); dispatch(resetJustOpenedProject()); } else { dispatch(showToast(1500)); - dispatch(setToastText('Project saved.')); + dispatch(setToastText('Sketch saved.')); } } }) .catch((error) => { const { response } = error; dispatch(endSavingProject()); - dispatch(setToastText('Failed to save project.')); + dispatch(setToastText('Failed to save sketch.')); dispatch(showToast(1500)); if (response.status === 403) { dispatch(showErrorModal('staleSession')); @@ -197,19 +197,19 @@ export function saveProject(selectedFile = null, autosave = false) { if (!autosave) { if (state.preferences.autosave) { dispatch(showToast(5500)); - dispatch(setToastText('Project saved.')); + dispatch(setToastText('Sketch saved.')); setTimeout(() => dispatch(setToastText('Autosave enabled.')), 1500); dispatch(resetJustOpenedProject()); } else { dispatch(showToast(1500)); - dispatch(setToastText('Project saved.')); + dispatch(setToastText('Sketch saved.')); } } }) .catch((error) => { const { response } = error; dispatch(endSavingProject()); - dispatch(setToastText('Failed to save project.')); + dispatch(setToastText('Failed to save sketch.')); dispatch(showToast(1500)); if (response.status === 403) { dispatch(showErrorModal('staleSession'));