Skip to content

Commit

Permalink
FIX #552
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmartyrk committed Dec 14, 2023
1 parent cb24fef commit 3e8e1aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/app/interfaces/attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,9 @@ export interface Attachment {
id: string,
name: string,
link: string,
type: string
type: string,
source: string,
updatedAt: string,
createdAt: string,
deletedAt: string
}
5 changes: 4 additions & 1 deletion src/app/topic/topic.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ export class TopicComponent implements OnInit {
}

downloadAttachment(topicId: string, attachment: Attachment) {
return this.Upload.download(topicId, attachment.id, this.auth.user.value.id || '');
if (attachment.source === this.TopicAttachmentService.SOURCES.upload) {
return this.Upload.download(topicId, attachment.id, this.auth.user.value.id || '');
}
return window.open(attachment.link, '_blank');
};

hasVoteEndedExpired(topic: Topic, vote: Vote) {
Expand Down

0 comments on commit 3e8e1aa

Please sign in to comment.