Skip to content

Commit

Permalink
Merge pull request #340 from atbalaji/main
Browse files Browse the repository at this point in the history
Fixed Sort, Search and Refresh Bug
  • Loading branch information
Kritika30032002 authored Jan 13, 2024
2 parents ce8471e + f87dd88 commit e016fe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ <h2 style=" text-align: center" class="mt-5 animate__animated animate__fadeInUp
document.addEventListener('DOMContentLoaded', function () {
var taskList = document.getElementById('taskList');
var taskActions = document.getElementById('taskActions');

init();

// Function to check and toggle the display of taskActions
function checkTasksAndToggle() {
if (taskList && taskList.children.length > 0) {
Expand Down
9 changes: 1 addition & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,7 @@ function getTasksFromLocalStorage() {
// Function to display tasks
function loadTasksFromLocalStorage() {
const tasks = getTasksFromLocalStorage();
const tasksHeading = document.getElementById("heading-tasks");
const searchBar = document.querySelector(".search-bar");
const clearButton = document.querySelector(".clear-btn");
const clearButton = document.querySelector(".clear_btn");
const dropdown = document.querySelector(".dropdown");

if (tasks.length > 0) {
Expand Down Expand Up @@ -902,11 +900,6 @@ function createNewTask(taskTitle, createdDate, dueDate, priority, description, i
displayTaskDetails(li);
}

// Function to initialize the application
function init() {
loadTasksFromLocalStorage();
}

// Function to hide preloader
document.addEventListener("DOMContentLoaded", function () {
setTimeout(function () {
Expand Down

0 comments on commit e016fe1

Please sign in to comment.