We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5554b25 + 5cd2c95 commit ed1e1b6Copy full SHA for ed1e1b6
2 files changed
src/scripts/Modules/TodoApp.js
@@ -4,6 +4,11 @@ import TodoItem from './TodoItem';
4
class TodoApp {
5
constructor() {
6
this.projects = [];
7
+ }
8
+
9
+ async initialize() {
10
+ await this.loadFromAPI();
11
+ // Only create default project if no projects exist after loading
12
if (this.projects.length === 0) {
13
this.addProject("Default");
14
}
src/scripts/Modules/UI.js
@@ -20,7 +20,7 @@ export default class UI {
20
21
22
async loadHomepage() {
23
- await this.app.loadFromAPI(); // Fetch projects from the server first
+ await this.app.initialize(); // Fetch projects from the server first
24
this.loadProjects();
25
this.OpenProject(this.selectedProject);
26
0 commit comments