mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-03 19:38:44 -05:00
Removed the auto-save facility from Notes as it was lacking any configuration and worked in unwanted moment(s).
28 lines
858 B
C++
28 lines
858 B
C++
// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "NoteEditWindowPresenter.hpp"
|
|
|
|
namespace app::notes
|
|
{
|
|
NoteEditWindowPresenter::NoteEditWindowPresenter(std::unique_ptr<AbstractNotesRepository> &¬esRepository)
|
|
: notesRepository{std::move(notesRepository)}
|
|
{}
|
|
|
|
void NoteEditWindowPresenter::onNoteChanged()
|
|
{
|
|
noteChanged = true;
|
|
}
|
|
|
|
void NoteEditWindowPresenter::save(std::shared_ptr<NotesRecord> ¬e)
|
|
{
|
|
notesRepository->save(*note, [note](bool succeed, std::uint32_t noteId) {
|
|
LOG_INFO("Note %s", succeed ? "successfully saved" : "save failed");
|
|
if (succeed) {
|
|
note->ID = noteId;
|
|
}
|
|
});
|
|
noteChanged = false;
|
|
}
|
|
} // namespace app::notes
|