Skip to content

Commit

Permalink
fixed receive action typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AceTheCreator committed Sep 20, 2023
1 parent a5f9594 commit fd3a6ec
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions library/src/containers/Operations/Operation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function getTypeInformation({
type: PayloadType;
config: ConfigInterface;
}): { borderColor: string; typeLabel: string } {
if (type === PayloadType.RECIEVE) {
if (type === PayloadType.RECEIVE) {
return {
borderColor: 'border-green-600 text-green-600',
typeLabel: config.subscribeLabel ?? SUBSCRIBE_LABEL_DEFAULT_TEXT,
Expand Down Expand Up @@ -216,7 +216,7 @@ export const OperationInfo: React.FunctionComponent<Props> = props => {
const externalDocs = operation.externalDocs();
const operationId = operation.id();
if (operation.action() !== type) {
type = PayloadType.RECIEVE;
type = PayloadType.RECEIVE;
}
const { borderColor, typeLabel } = getTypeInformation({ type, config });

Expand Down Expand Up @@ -285,6 +285,7 @@ export const OperationReplyInfo: React.FunctionComponent<Props> = props => {
if (reply === undefined) return <></>;
const config = useConfig();
const { typeLabel } = getTypeInformation({ type, config });
console.log(typeLabel);
const replyMessages = reply.messages();
const explicitChannel = reply.channel();

Expand All @@ -295,13 +296,14 @@ export const OperationReplyInfo: React.FunctionComponent<Props> = props => {
<div className="flex items-center pt-4">
<div
className={`w-1 h-11 ${
typeLabel === 'SEND' ? 'bg-red-600' : 'bg-orange-600'
typeLabel === 'REQUEST' ? 'bg-red-600' : 'bg-orange-600'
}`}
></div>
<div className="p-4">
<h3 className="text-sm">
<span className="mr-2 uppercase" title={type}>
{typeLabel === 'SEND' ? 'Requester' : 'Replier'} information
{typeLabel === 'REQUEST' ? 'Requester' : 'Replier'}{' '}
information
</span>
</h3>
{explicitChannel && (
Expand Down
4 changes: 2 additions & 2 deletions library/src/containers/Operations/Operations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,12 @@ export const Operations: React.FunctionComponent = () => {
className="mb-12"
key={`sub-${operation.id()}`}
id={CommonHelpers.getIdentifier(
`operation-${PayloadType.RECIEVE}-${operation.id()}`,
`operation-${PayloadType.RECEIVE}-${operation.id()}`,
config,
)}
>
<Operation
type={PayloadType.RECIEVE}
type={PayloadType.RECEIVE}
operation={operation}
channelName={channelAddress}
channel={channel}
Expand Down
2 changes: 1 addition & 1 deletion library/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface ParserReturn {

export enum PayloadType {
SEND = 'send',
RECIEVE = 'receive',
RECEIVE = 'receive',
REQUEST = 'request',
REPLY = 'reply',
}
Expand Down

0 comments on commit fd3a6ec

Please sign in to comment.