Skip to content

Commit

Permalink
function renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
asliayk committed Jan 20, 2025
1 parent 3f374ea commit ccba632
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class ChannelFormComponent implements OnInit, OnChanges, OnDestroy {
return this.form.get('isAnnouncementChannel');
}

get isisCourseWideChannelControl() {
get isCourseWideChannelControl() {
return this.form.get('isCourseWideChannel');
}

Expand Down Expand Up @@ -107,8 +107,8 @@ export class ChannelFormComponent implements OnInit, OnChanges, OnDestroy {
});
}

if (this.isisCourseWideChannelControl) {
this.isisCourseWideChannelControl.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe((value) => {
if (this.isCourseWideChannelControl) {
this.isCourseWideChannelControl.valueChanges.pipe(takeUntil(this.ngUnsubscribe)).subscribe((value) => {
this.isCourseWideChannelChanged.emit(value);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD
}
}

applyFilter(): void {
applyPinnedMessageFilter(): void {
if (this.showOnlyPinned()) {
this.posts = this.allPosts.filter((post) => post.displayPriority === DisplayPriority.PINNED);
} else {
Expand Down Expand Up @@ -326,7 +326,7 @@ export class ConversationMessagesComponent implements OnInit, AfterViewInit, OnD
this.previousScrollDistanceFromTop = this.content.nativeElement.scrollHeight - this.content.nativeElement.scrollTop;
}

this.applyFilter();
this.applyPinnedMessageFilter();

this.posts = this.posts
.slice()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ examples.forEach((activeConversation) => {

component.allPosts = [pinnedPost, regularPost];
jest.spyOn(component, 'showOnlyPinned').mockReturnValue(true);
component.applyFilter();
component.applyPinnedMessageFilter();

expect(component.posts).toEqual([pinnedPost]);
});
Expand All @@ -314,7 +314,7 @@ examples.forEach((activeConversation) => {

component.allPosts = [pinnedPost, regularPost];
jest.spyOn(component, 'showOnlyPinned').mockReturnValue(false);
component.applyFilter();
component.applyPinnedMessageFilter();

expect(component.posts).toEqual([pinnedPost, regularPost]);
});
Expand All @@ -326,7 +326,7 @@ examples.forEach((activeConversation) => {

const emitSpy = jest.spyOn(component.pinnedCount, 'emit');
component.allPosts = [pinnedPost1, pinnedPost2, regularPost];
component.applyFilter();
component.applyPinnedMessageFilter();

expect(emitSpy).toHaveBeenCalledWith(2);
});
Expand Down

0 comments on commit ccba632

Please sign in to comment.