From 46456fd439b891d804e988a3de5c28c633688bfb Mon Sep 17 00:00:00 2001 From: Janet Vorobyeva Date: Tue, 19 Sep 2023 00:11:23 -0700 Subject: [PATCH] lint --- app/client/components/Cursor.ts | 10 +++++----- app/client/ui/selectBy.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/client/components/Cursor.ts b/app/client/components/Cursor.ts index e7156583..21136f09 100644 --- a/app/client/components/Cursor.ts +++ b/app/client/components/Cursor.ts @@ -136,8 +136,8 @@ export class Cursor extends Disposable { // For determining priority, this cursor will become the latest edited whether we call it once or twice. // For updating observables, the double-update might cause cursor-linking observables in LinkingState to // double-update, but it should be transient and get resolved immediately. - this.autoDispose(this._properRowId.subscribe(() => { this.cursorEdited(); })); - this.autoDispose(this.fieldIndex.subscribe(() => { this.cursorEdited(); })); + this.autoDispose(this._properRowId.subscribe(() => { this._cursorEdited(); })); + this.autoDispose(this.fieldIndex.subscribe(() => { this._cursorEdited(); })); // On dispose, save the current cursor position to the section model. this.onDispose(() => { baseView.viewSection.lastCursorPos = this.getCursorPos(); }); @@ -183,7 +183,7 @@ export class Cursor extends Disposable { this.fieldIndex(cursorPos.fieldIndex); } - // NOTE: cursorEdited + // NOTE: _cursorEdited // We primarily update cursorEdited counter from a this._properRowId.subscribe(), since that catches updates // from many sources (setCursorPos, arrowKeys, save/load, filter/sort-changes, etc) // However, when deleting a row with several sections linked together, there can be a case where this fails: @@ -192,7 +192,7 @@ export class Cursor extends Disposable { // This caused a bug when several viewSections were cursor-linked to each other and a row was deleted. // We can explicitly call cursorEdited again here. It'll cause cursorEdited to be called twice sometimes, // but that shouldn't cause any problems, since we don't care about edit counts, just who was edited latest. - this.cursorEdited() + this._cursorEdited(); } finally { // Make sure we reset this even on error this._silentUpdatesFlag = false; @@ -211,7 +211,7 @@ export class Cursor extends Disposable { // _EXCEPT FOR: when cursor is set by linking // this is used to determine which widget/cursor has most recently been touched, // and therefore which one should be used to drive linking if there's a conflict - private cursorEdited(): void { + private _cursorEdited(): void { // If updating as a result of links, we want to NOT update lastEdited if (!this._silentUpdatesFlag) { this._lastEditedAt(nextSequenceNum()); } diff --git a/app/client/ui/selectBy.ts b/app/client/ui/selectBy.ts index 5b23e405..3f673e4d 100644 --- a/app/client/ui/selectBy.ts +++ b/app/client/ui/selectBy.ts @@ -163,8 +163,8 @@ function isValidLink(source: LinkNode, target: LinkNode) { // they would stop being ancestors of src) // NOTE: we're guaranteed to hit target before the end of the array (because of the `if(...includes...)` above) // ALSO NOTE: isAncestorSameTableCursorLink may be 1 shorter than ancestors, but it's accounted for by the above - let i = 0 - while(true) { + let i = 0; + for (;;) { if (source.ancestors[i] == target.section.getRowId()) { // We made it! All is well break;