Skip to content

Commit aee78a4

Browse files
authored
autoscroll: don't log same debug message multiple times (#104)
1 parent 8913ecd commit aee78a4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/autoscroll.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class AutoScroll extends Behavior {
1212
samePosCount: number;
1313

1414
origPath: string;
15+
lastMsg = "";
1516

1617
constructor(autofetcher: AutoFetcher) {
1718
super();
@@ -37,6 +38,14 @@ export class AutoScroll extends Behavior {
3738
return this.currScrollPos() < Math.max(scrollElem.clientHeight, scrollElem.scrollHeight);
3839
}
3940

41+
debug(msg: string) {
42+
if (this.lastMsg === msg) {
43+
return;
44+
}
45+
super.debug(msg);
46+
this.lastMsg = msg;
47+
}
48+
4049
hasScrollEL(obj) {
4150
try {
4251
return !!self["getEventListeners"](obj).scroll;

0 commit comments

Comments
 (0)