refactor(segment): remove uneccessary function

This commit is contained in:
Brandy Carney
2024-09-18 15:39:19 -04:00
parent 00c378f0f5
commit 44a0855844

View File

@ -17,7 +17,7 @@ export class SegmentView implements ComponentInterface {
if (!atSnappingPoint) return; if (!atSnappingPoint) return;
const index = Math.round(scrollLeft / offsetWidth); const index = Math.round(scrollLeft / offsetWidth);
const segmentContent = this.getSegmentContentAtIndex(index); const segmentContent = this.getSegmentContents()[index];
if (segmentContent === null || segmentContent === undefined) { if (segmentContent === null || segmentContent === undefined) {
return; return;
@ -50,10 +50,6 @@ export class SegmentView implements ComponentInterface {
return Array.from(this.el.querySelectorAll('ion-segment-content')); return Array.from(this.el.querySelectorAll('ion-segment-content'));
} }
private getSegmentContentAtIndex(index: number) {
return this.getSegmentContents()[index];
}
private getSegmentButtonById(id: string) { private getSegmentButtonById(id: string) {
return document.querySelector(`ion-segment-button[content-id="${id}"]`); return document.querySelector(`ion-segment-button[content-id="${id}"]`);
} }