@jkellerman
Posted
I've had a quick look and checked the applications tab in chrome dev tools. The links are saving but not loading.
I would do something along the lines of:
- create a function that loads the todos.
E.g function loadTodos() {
const todos = localStorage.getItem(todos);
return JSON.parse(todosString) || [ ]; }
- create function that saves the todos
E.g function saveTodos() {
localStorage.setItem(todos, JSON.stringify(todos)); }
The loadTodos() function should run every time the page loads and saveTodos() should run whenever the user shortens a url.
Hope this helps! Happy coding
Marked as helpful
@SatellitePeace
Posted
Thanks, @jkellerman i will definitely try this