Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/scripts/Modules/TodoApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ import TodoItem from './TodoItem';
class TodoApp {
constructor() {
this.projects = [];
}

async initialize() {
await this.loadFromAPI();
// Only create default project if no projects exist after loading
if (this.projects.length === 0) {
this.addProject("Default");
}
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/Modules/UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class UI {
}

async loadHomepage() {
await this.app.loadFromAPI(); // Fetch projects from the server first
await this.app.initialize(); // Fetch projects from the server first
this.loadProjects();
this.OpenProject(this.selectedProject);
}
Expand Down
Loading