Skip to content

Commit

Permalink
Merge pull request #42 from decentralized-identity/fix/external-links
Browse files Browse the repository at this point in the history
Fix: external links
  • Loading branch information
dbluhm authored Oct 4, 2023
2 parents 239bbd6 + 8135374 commit ea09c0c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/pages/profile/messaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,10 @@ class MessageHistoryComponent
})
}

private messageTypeToProtocol(messageType: string) {
return messageType.slice(0, messageType.lastIndexOf("/"))
}

viewMessage(message: Message) {
switch (message.type) {
case "https://didcomm.org/basicmessage/2.0/message":
Expand Down Expand Up @@ -385,7 +389,20 @@ class MessageHistoryComponent
"li",
m("span", [
`${disclosure["feature-type"]}: `,
m("a", { href: disclosure.id }, disclosure.id),
m(
"a",
{
href: this.messageTypeToProtocol(disclosure.id),
target: "_blank",
},
[
disclosure.id,
m(
"span.icon",
m(`i.fas.fa-arrow-up-right-from-square.is-small`)
),
]
),
])
)
)
Expand All @@ -400,7 +417,10 @@ class MessageHistoryComponent
class: "unhandled",
inspectable: true,
},
[m("a", { href: message.type }, message.type)]
m("a", { href: message.type, target: "_blank" }, [
message.type,
m("span.icon", m(`i.fas.fa-arrow-up-right-from-square.is-small`)),
])
)
}
}
Expand Down

0 comments on commit ea09c0c

Please sign in to comment.