fix(ui): app crashing on 401 error (#6287)

* fix(ui): app crashing on 401 error

* add null checkes
This commit is contained in:
Chirag Madlani 2022-07-23 02:32:02 +05:30 committed by GitHub
parent ac4ad77e78
commit c9be0ceff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -157,6 +157,7 @@ export const AuthProvider = ({
localStorage.removeItem(oidcTokenKey); localStorage.removeItem(oidcTokenKey);
setIsUserAuthenticated(false); setIsUserAuthenticated(false);
setLoadingIndicator(false); setLoadingIndicator(false);
clearTimeout(timeoutId);
if (forceLogout) { if (forceLogout) {
onLogoutHandler(); onLogoutHandler();
} else { } else {

View File

@ -43,7 +43,7 @@ const Emoji = ({ reaction, reactionList, onReactionSelect }) => {
// check if current user has reacted with emoji // check if current user has reacted with emoji
const isReacted = reactionList.some( const isReacted = reactionList.some(
(reactionItem) => reactionItem.user.id === currentUser.id (reactionItem) => reactionItem.user.id === currentUser?.id
); );
const reactedUserList = reactionList.map( const reactedUserList = reactionList.map(

View File

@ -51,7 +51,7 @@ const Reactions = ({ reactions, onReactionSelect }) => {
const isReacted = (reactionType) => { const isReacted = (reactionType) => {
return reactions.some( return reactions.some(
(reactionItem) => (reactionItem) =>
reactionItem.user.id === currentUser.id && reactionItem.user.id === currentUser?.id &&
reactionType === reactionItem.reactionType reactionType === reactionItem.reactionType
); );
}; };