Skip to content

Commit

Permalink
refactor after reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
asliayk committed Oct 17, 2024
1 parent 6b30cfc commit 315f622
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@ export class ConversationOptionsComponent implements OnInit, OnDestroy {

onHiddenClicked(event: MouseEvent) {
event.stopPropagation();
if (!this.course.id || !this.conversation.id) return;
if (!this.course.id || !this.conversation.id) {
return;
}

// If the conversation is in favorites and is being hidden, it is also removed from favorites
if (!this.conversation.isHidden && this.conversation.isFavorite) {
this.conversationService.updateIsFavorite(this.course.id, this.conversation.id, false).subscribe({
next: () => {
Expand All @@ -95,9 +96,10 @@ export class ConversationOptionsComponent implements OnInit, OnDestroy {

onFavoriteClicked($event: MouseEvent) {
$event.stopPropagation();
if (!this.course.id || !this.conversation.id) return;
if (!this.course.id || !this.conversation.id) {
return;
}

// If the conversation is hidden and is being favorited, it is also removed from the hidden list
if (this.conversation.isHidden && !this.conversation.isFavorite) {
this.conversationService.updateIsHidden(this.course.id, this.conversation.id, false).subscribe({
next: () => {
Expand Down

0 comments on commit 315f622

Please sign in to comment.