Conversation
TeddyRoncin
left a comment
There was a problem hiding this comment.
Sorry j'ai commencé en anglais au début à écrire, du coup t'as 2-3 comments en anglais (déformation professionnelle 🤣 )
| .on('success', (body) => { | ||
| if (body.status === 'no_api_key') { | ||
| if (body.status === 'no_account') { | ||
| if (!body.token) return; |
There was a problem hiding this comment.
In case of "no_account", there will always be a token
There was a problem hiding this comment.
Qu'est-ce qui serait le plus propre selon toi pour corriger ça ?
Car si je ne met pas la condition, le type de body.token est string | null. Je met un as string ? je sais pas si c'est très propre...
Même chose pour les autres comments
There was a problem hiding this comment.
body.token!, ça assert que token est pas null | undefined
There was a problem hiding this comment.
Ou sinon goat et tu fais un type qui dit ce que je t'ai dit dans le comment 😂
| return; | ||
| } | ||
| if (body.status === 'no_api_key') { | ||
| if (!body.token) return; |
| window.location.assign(body.redirectUrl); | ||
| return; | ||
| } | ||
| if (!body.token) return; |
There was a problem hiding this comment.
Same, if there is no redirectUrl, there is a token (it's one or the other)
No description provided.