Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
fix: update the copy for the default fallbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Sep 9, 2023
1 parent 5e445fa commit 1d97ca0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
11 changes: 9 additions & 2 deletions packages/content-type-reaction/src/Reaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,14 @@ export class ReactionCodec implements ContentCodec<Reaction> {
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display reactions";
fallback(content: Reaction): string | undefined {
switch (content.action) {
case "added":
return `Reacted “${content.content}” to an earlier message`;
case "removed":
return `Removed “${content.content}” from an earlier message`;
default:
return undefined;
}
}
}
2 changes: 1 addition & 1 deletion packages/content-type-read-receipt/src/ReadReceipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ReadReceiptCodec implements ContentCodec<ReadReceipt> {
};
}

fallback(): string | undefined {
fallback(content: ReadReceipt): string | undefined {
return undefined;
}
}
4 changes: 2 additions & 2 deletions packages/content-type-remote-attachment/src/Attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class AttachmentCodec implements ContentCodec<Attachment> {
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display attachments";
fallback(content: Attachment): string | undefined {
return `Can’t display "${content.filename}". This app doesn’t support attachments.`;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class RemoteAttachmentCodec implements ContentCodec<RemoteAttachment> {
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display attachments";
fallback(content: RemoteAttachment): string | undefined {
return `Can’t display "${content.filename}". This app doesn’t support attachments.`;
}
}
4 changes: 2 additions & 2 deletions packages/content-type-reply/src/Reply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export class ReplyCodec implements ContentCodec<Reply> {
};
}

fallback(): string | undefined {
return "Error: Sorry, this app cannot display quote replies";
fallback(content: Reply): string | undefined {
return `Replied with “${content.content}” to an earlier message`;
}
}

0 comments on commit 1d97ca0

Please sign in to comment.