Skip to content

Commit

Permalink
chore(tweaks): add requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Atharva-Kanherkar committed Oct 25, 2024
1 parent 1a597ea commit 0b21452
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/home/sorting/sorting-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,19 @@ export class SortingManager {

// Apply the new ordering state
input.setAttribute("data-ordering", newOrdering);

input.parentElement?.childNodes.forEach((node) => {
if (node instanceof HTMLInputElement) {
node.setAttribute("data-ordering", "");
}
});
// Clear sorting if disabled
if (newOrdering === "disabled") {
this._lastChecked = null; // Reset the last checked input
input.checked = false; // Uncheck the button
this._filterTextBox.value = ""; // Clear the text filter box
this._clearSorting(); // Reset sorting to default or disabled state


} else {
input.checked = input !== this._lastChecked; // Handle checking the radio
this._lastChecked = input.checked ? input : null;
Expand All @@ -169,7 +175,7 @@ export class SortingManager {
void displayGitHubIssues(option as Sorting, { ordering: newOrdering });
} catch (error) {
renderErrorCatch(error as ErrorEvent);
// load from network in the background
// load from network in the background
// const fetchedPreviews = await fetchIssuePreviews();
// const cachedTasks = taskManager.getTasks();
// const updatedCachedIssues = verifyGitHubIssueState(cachedTasks, fetchedPreviews);
Expand Down

0 comments on commit 0b21452

Please sign in to comment.