dsfai2020 / Task-and-Nutrition-Manager

An agile planning application that tracks tasks, ideas and nutrition goals. This app is designed to assist with everyday productivity, progress tracking and fitness.
1 stars 0 forks source link

Logs are triggering output of the dictionary way too many times #68

Closed dsfai2020 closed 3 months ago

dsfai2020 commented 3 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to the browser. Press control + i and go into the console log output with the react application running.
  2. Click on the console and make sure that only the info and log are toggled.
  3. Scroll down to log.
  4. See error. The dictionary is being sent to the log more than 10 times.

Expected behavior I just needed the dictionary to display once in the log after everything was added to it from the loop.

Screenshots image

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context The reason that this was such a big problem was because the console logs weren't contained inside of the if () {} code brackets. This caused the execution of the console log to occur any time the for loop happened. This was preventing me from isolating a dictionary built from a customized filter. I needed to do this so that I can load from the ui states based on these conditions in the future if save data is present in the local storage.