From d9d22f2b07492febe7088e1d571b9e7409a6f5a3 Mon Sep 17 00:00:00 2001 From: situchan Date: Tue, 30 May 2023 15:05:05 +0100 Subject: [PATCH 1/3] fix crash when open report for anonymous user --- src/libs/ReportUtils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 249e862b753d..73908be35d5d 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -455,6 +455,11 @@ function isAllowedToComment(report) { return true; } + // If user opens public chat room directly from deep link after logout + if (!allPolicies) { + return false; + } + // If we've made it here, commenting on this report is restricted. // If the user is an admin, allow them to post. const policy = allPolicies[`${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`]; From 686abf7494bf83d67a889687cc071e1632268712 Mon Sep 17 00:00:00 2001 From: situchan Date: Tue, 30 May 2023 15:40:19 +0100 Subject: [PATCH 2/3] fix console error on web splash --- src/libs/BootSplash/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/BootSplash/index.js b/src/libs/BootSplash/index.js index b9b8692f687c..ff7ab5562b1f 100644 --- a/src/libs/BootSplash/index.js +++ b/src/libs/BootSplash/index.js @@ -9,9 +9,10 @@ function hide() { return document.fonts.ready.then(() => { const splash = document.getElementById('splash'); - splash.style.opacity = 0; + if (splash) splash.style.opacity = 0; return resolveAfter(250).then(() => { + if (!splash || !splash.parentNode) return; splash.parentNode.removeChild(splash); }); }); From 54ca45359319065586136b95aaed55041ba717b1 Mon Sep 17 00:00:00 2001 From: Situ Chandra Shil <108292595+situchan@users.noreply.github.com> Date: Tue, 30 May 2023 09:45:16 -0600 Subject: [PATCH 3/3] update comment Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 73908be35d5d..3de5af38a306 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -455,7 +455,7 @@ function isAllowedToComment(report) { return true; } - // If user opens public chat room directly from deep link after logout + // If unauthenticated user opens public chat room using deeplink, they do not have policies available and they cannot comment if (!allPolicies) { return false; }