Skip to content

Commit

Permalink
- fix: crash when lastMessage is null (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol authored Dec 1, 2023
1 parent 8dcfa1d commit 2453677
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions apps/shinkai-visor/src/components/inboxes/inboxes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const Inboxes = () => {
const navigateToInbox = (inbox: {
inbox_id: string;
custom_name: string;
last_message: ShinkaiMessage;
last_message?: ShinkaiMessage;
}) => {
history.push(`/inboxes/${encodeURIComponent(inbox.inbox_id)}`, { inbox });
};
Expand Down Expand Up @@ -136,8 +136,8 @@ export const Inboxes = () => {
</div>
</div>
</div>
<span className="shrink-0 self-start pt-[2px] text-xs lowercase text-gray-100">
{inbox.last_message.external_metadata
<span className="min-w-[32px] text-end shrink-0 self-start pt-[2px] text-xs lowercase text-gray-100">
{inbox.last_message?.external_metadata
?.scheduled_time &&
formatDateToMonthAndDay(
new Date(
Expand Down
2 changes: 1 addition & 1 deletion libs/shinkai-message-ts/src/models/ShinkaiMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ export interface RegistrationCode {
export type SmartInbox = {
custom_name: string;
inbox_id: string;
last_message: ShinkaiMessage;
last_message?: ShinkaiMessage;
};

0 comments on commit 2453677

Please sign in to comment.