From b18913717f2596b55c672bcd98ab998a03197f38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Poizat?= Date: Thu, 21 Dec 2023 11:41:26 +0100 Subject: [PATCH] fix(backup): Do not display 'Backup already preparing' message When flagship app backup throw an error, it is displayed by Photos in a red alert. We do not want this for 'Backup already preparing' message. We will find a better solution on flagship app side later. --- src/photos/ducks/backup/helpers/error.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/photos/ducks/backup/helpers/error.js b/src/photos/ducks/backup/helpers/error.js index 6fc2748d1..6515f0cee 100644 --- a/src/photos/ducks/backup/helpers/error.js +++ b/src/photos/ducks/backup/helpers/error.js @@ -1,11 +1,22 @@ +const IGNORED_ERRORS = [ + 'Backup already preparing', + 'Copia de seguridad ya se está preparando', + 'Sauvegarde déjà en préparation' +] + export const parseBackupError = ({ message }) => { try { const parsed = JSON.parse(message) + return { message: parsed.message, statusCode: parsed.statusCode } } catch { + if (IGNORED_ERRORS.includes(message)) { + return null + } + return { message }