Skip to content
Open
Changes from all commits
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
9 changes: 6 additions & 3 deletions library/src/containers/Operations/Operation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ interface Props {
channel: ChannelInterface;
}

// Construct the full relative URL, including path, query parameters to avoid path overwrite when
// location.hash is included
const relativePathname = `${window.location.pathname}${window.location.search}`;

export const Operation: React.FunctionComponent<Props> = (props) => {
const { type = PayloadType.SEND, operation, channelName, channel } = props;
const config = useConfig();
Expand All @@ -40,7 +44,6 @@ export const Operation: React.FunctionComponent<Props> = (props) => {
channel.parameters() !== undefined
? SchemaHelpers.parametersToSchema(channel.parameters())
: undefined;

return (
<div>
<div className="panel-item--center px-8">
Expand All @@ -53,7 +56,7 @@ export const Operation: React.FunctionComponent<Props> = (props) => {
{servers.map((server) => (
<li className="inline-block mt-2 mr-2" key={server.id()}>
<a
href={`${window.location.pathname}#${CommonHelpers.getIdentifier(
href={`${relativePathname}#${CommonHelpers.getIdentifier(
'server-' + server.id(),
config,
)}`}
Expand Down Expand Up @@ -406,7 +409,7 @@ export const OperationReplyChannelInfo: React.FunctionComponent<Props> = ({
{servers.map((server) => (
<li className="inline-block mt-2 mr-2" key={server.id()}>
<a
href={`${window.location.pathname}#${CommonHelpers.getIdentifier(
href={`${relativePathname}#${CommonHelpers.getIdentifier(
'server-' + server.id(),
config,
)}`}
Expand Down