Skip to content

Commit

Permalink
Merge pull request #43 from imperviousai/number-fix
Browse files Browse the repository at this point in the history
fixed typo mismatch error
  • Loading branch information
markhandlersec authored Oct 18, 2022
2 parents 507c9f8 + 74423ec commit 1903687
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/pages/d/chat.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ const RenderConversationSection = ({ unreadMessages, message }) => {
}, [message, contactsRes?.data.contacts, myDid]);

const renderContent = () => {
if (+message?.data.body.content !== "NaN") {
return message?.data.body.content;
}
if (message?.data.type === "https://didcomm.org/webrtc/1.0/sdp") {
const { signal } = message?.data.body.content;
if (signal.type === "offer") {
Expand Down Expand Up @@ -920,8 +923,8 @@ const ConversationBody = ({ activeConversation }) => {

// lastly check for images over didcomm (standard is different)
const msg = message.data.body.content;
if (msg === 1 || msg === "1") {
return "1";
if (+msg !== "NaN") {
return msg;
}
if (isJSON(msg)) {
if (JSON.parse(msg).data) {
Expand Down
3 changes: 3 additions & 0 deletions client/pages/d/dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const MessagesTable = ({ conversations, unreadMessages }) => {
};

const renderContent = (lastMessage) => {
if (+lastMessage?.data.body.content !== "NaN") {
return lastMessage?.data.body.content;
}
if (lastMessage?.data.type === "https://didcomm.org/webrtc/1.0/sdp") {
return "Sent you an invite to connect.";
} else if (lastMessage?.data.type === "file-transfer-done") {
Expand Down

0 comments on commit 1903687

Please sign in to comment.