Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 404 authenticate pusher api call #29590

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const defaultProps = {
* @returns {String}
*/
function getReportID(route) {
return String(lodashGet(route, 'params.reportID', null));
return String(lodashGet(route, 'params.reportID', ''));
}

function ReportScreen({
Expand Down Expand Up @@ -345,7 +345,7 @@ function ReportScreen({
// any `pendingFields.createChat` or `pendingFields.addWorkspaceRoom` fields are set to null.
// Existing reports created will have empty fields for `pendingFields`.
const didCreateReportSuccessfully = !report.pendingFields || (!report.pendingFields.addWorkspaceRoom && !report.pendingFields.createChat);
if (!didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {
if (!!reportID && !didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!!reportID && !didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {
if (ReportUtils.isValidReportIDFromPath(reportID) && !didSubscribeToReportLeavingEvents.current && didCreateReportSuccessfully) {

To keep it consistent, let's use this util function ReportUtils.isValidReportIDFromPath. Also I think we prefer early returns

if (!ReportUtils.isValidReportIDFromPath(reportID)){
    return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. will update this

Report.subscribeToReportLeavingEvents(reportID);
didSubscribeToReportLeavingEvents.current = true;
}
Expand Down
Loading