Skip to content

Commit

Permalink
fix(backup): Do not display 'Backup already preparing' message
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
zatteo committed Dec 21, 2023
1 parent 29d05b2 commit b189137
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/photos/ducks/backup/helpers/error.js
Original file line number Diff line number Diff line change
@@ -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
}
Expand Down

0 comments on commit b189137

Please sign in to comment.