Skip to content

Commit

Permalink
ensure trailing slash in url
Browse files Browse the repository at this point in the history
  • Loading branch information
rojiphil committed Jun 19, 2023
1 parent 9569e76 commit ce0d562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/ShareCodePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import ContextMenuItem from '../components/ContextMenuItem';
import * as UserUtils from '../libs/UserUtils';
import ROUTES from '../ROUTES';
import withEnvironment, {environmentPropTypes} from '../components/withEnvironment';
import * as Url from '../libs/Url';

const propTypes = {
/** The report currently being looked at */
Expand All @@ -43,7 +44,8 @@ class ShareCodePage extends React.Component {
const isReport = this.props.report != null && this.props.report.reportID != null;
const subtitle = ReportUtils.getChatRoomSubtitle(this.props.report);

const url = isReport ? `${this.props.environmentURL}r/${this.props.report.reportID}` : `${this.props.environmentURL}details?login=${encodeURIComponent(this.props.session.email)}`;
const urlWithTrailingSlash = Url.addTrailingForwardSlash(this.props.environmentURL);
const url = isReport ? `${urlWithTrailingSlash}r/${this.props.report.reportID}` : `${urlWithTrailingSlash}details?login=${encodeURIComponent(this.props.session.email)}`;

const platform = getPlatform();
const isNative = platform === CONST.PLATFORM.IOS || platform === CONST.PLATFORM.ANDROID;
Expand Down

0 comments on commit ce0d562

Please sign in to comment.