fix(rn,dynamic-branding) fix handling bogus response from the backend

This commit is contained in:
Saúl Ibarra Corretgé 2022-12-15 11:04:27 +01:00 committed by Saúl Ibarra Corretgé
parent cbbe58a1ec
commit c30d1e7479
1 changed files with 7 additions and 4 deletions

View File

@ -32,10 +32,13 @@ MiddlewareRegistry.register(store => next => action => {
inviteDomain
};
// The backend may send an empty string, make sure we skip that.
if (Array.isArray(avatarBackgrounds)) {
// TODO: implement support for gradients.
action.value.avatarBackgrounds = avatarBackgrounds.filter(
(color: string) => !color.includes('linear-gradient')
);
}
break;
}