Skip to content

Commit

Permalink
Handle file types in message content items
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhulen committed Aug 9, 2024
1 parent d0ad08c commit ffc24e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dotnet/Common/Models/Chat/MessageContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class MessageContent
/// <summary>
/// The file name related to the Value, if applicable.
/// </summary>
[JsonPropertyName("file_name")]
[JsonPropertyName("fileName")]
public string? FileName { get; set; }

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions src/ui/UserPortal/components/ChatMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
<div v-else-if="content.type === 'html'">
<iframe :src="content.value" frameborder="0"></iframe>
</div>
<div v-else-if="content.type === 'file'">
Download <a :href="content.value" target="_blank">{{ content.fileName ?? content.value }}</a>
</div>
</div>
</template>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/ui/UserPortal/js/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export interface Message {

export interface MessageContent {
type: string;
file_name: string;
fileName: string;
value: string;
}

Expand Down

0 comments on commit ffc24e8

Please sign in to comment.