Skip to content

Commit

Permalink
Багофикс
Browse files Browse the repository at this point in the history
  • Loading branch information
YarikMix committed Mar 4, 2024
1 parent 7e89073 commit d68f0ad
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions public/src/pages/notes/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,31 @@ export default class NotesPage extends Page {

this.#notesContainer = document.querySelector(".notes-container");

let notes = AppNoteRequests.GetAll()
if (notes.length > 0) {
notes.then(resp => {
this.#renderNotes(resp);
});
} else {
const emptyNoteData = {
id: "empty-note",
data: {
title: "У вас пока нет заметок :(",
content: ""
}
const emptyNoteData = {
id: "empty-note",
data: {
title: "У вас пока нет заметок :(",
content: ""
}
}

AppNoteRequests.GetAll().then((notes) => {
if (notes.length > 0) {
notes.then(resp => {
this.#renderNotes(resp);
});
} else {
let emptyNote = new Note(this.#notesContainer, emptyNoteData);
emptyNote.render()
}
}).catch((err) => {
console.log(err)
let emptyNote = new Note(this.#notesContainer, emptyNoteData);
emptyNote.render()
}
})





this.#notesEditor = new NoteEditor(this.self.querySelector(".wrapper"), this.config.noteEditor);
Expand Down

0 comments on commit d68f0ad

Please sign in to comment.