Skip to content

Commit 921e714

Browse files
committed
Refactor: Removed unnecessary optional calls in shared utilities.
1 parent 5a59d4b commit 921e714

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

gnome-extensions/extension/shared/utilities/utilityCategorizedItemViewer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ export const CategorizedItemViewer = GObject.registerClass(
479479
}
480480

481481
this._pendingExternalSearchText = null;
482-
this._searchDebouncer?.cancel?.();
482+
this._searchDebouncer.cancel();
483483
this._suppressSearchTextChanged = true;
484484
this._searchComponent.setSearchText(normalizedQuery, { focus });
485485
this._suppressSearchTextChanged = false;

gnome-extensions/extension/shared/utilities/utilityMasonryLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ export const MasonryLayout = GObject.registerClass(
471471
*/
472472
_resolveLocalViewportTop(scrollTop) {
473473
const globalTop = Math.max(0, scrollTop || 0);
474-
const allocation = this.get_allocation_box?.();
474+
const allocation = this.get_allocation_box();
475475
if (!allocation) return globalTop;
476476
return Math.max(0, globalTop - allocation.y1);
477477
}

gnome-extensions/extension/shared/utilities/utilitySearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const SearchComponent = GObject.registerClass(
188188
* @returns {string} Current entry text.
189189
*/
190190
getSearchText() {
191-
return this._entry?.get_text?.() || '';
191+
return this._entry.get_text();
192192
}
193193

194194
/**

gnome-extensions/extension/shared/utilities/utilityStackLayout.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export const StackLayout = GObject.registerClass(
221221
*/
222222
_resolveLocalViewportTop(scrollTop) {
223223
const globalTop = Math.max(0, scrollTop || 0);
224-
const allocation = this.get_allocation_box?.();
224+
const allocation = this.get_allocation_box();
225225
if (!allocation) return globalTop;
226226
return Math.max(0, globalTop - allocation.y1);
227227
}

0 commit comments

Comments
 (0)