Skip to content

Commit 22c90f4

Browse files
committed
Trying to figure out the cause of high cpu usage.
1 parent 4b53f68 commit 22c90f4

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/app/home/home.page.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,9 @@
110110
</ion-toolbar>
111111
</ion-header>
112112

113-
<ion-content [scrollEvents]="true"
113+
<ion-content
114114
fxLayout="row"
115115
fxLayoutAlign="center start"
116-
(ionScroll)="onScroll($event)"
117116
style="padding: 10px;">
118117
<!-- 已下载/保存书籍列表 -->
119118
<app-book-list *ngIf="!search"

src/app/home/home.page.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,25 +263,6 @@ export class HomePage implements OnInit, AfterViewInit {
263263
});
264264
}
265265

266-
onScroll = async ($event) => {
267-
if(!this.search || this.searchEnd){ return; }
268-
if($event.target.localName !== 'ion-content') { return; }
269-
270-
const scrollElement = await $event.target.getScrollElement();
271-
const scrollHeight = scrollElement.scrollHeight - scrollElement.clientHeight;
272-
273-
const currentScrollDepth = $event.detail.scrollTop;
274-
275-
if(currentScrollDepth === scrollHeight){
276-
if(
277-
this.bookListCloud.length%20 === 0
278-
&& !(/gitlab/.test(this.platformSelected))
279-
){
280-
this.cloudSearch(this.bookListCloud.length/20 + 1);
281-
}
282-
}
283-
}
284-
285266
historySearch = (keywords: string, platform: string) => {
286267
this.keywords = keywords;
287268
this.platformSelected = platform;

0 commit comments

Comments
 (0)