diff --git a/external/mirai-core/src/ConfigImpl.cpp b/external/mirai-core/src/ConfigImpl.cpp index d380d52..c2c2cd1 100644 --- a/external/mirai-core/src/ConfigImpl.cpp +++ b/external/mirai-core/src/ConfigImpl.cpp @@ -5,9 +5,9 @@ */ #include "ConfigImpl.h" +#include "nlohmann/json.hpp" #include #include -#include #include #include @@ -16,6 +16,14 @@ namespace mirai ConfigImpl::ConfigImpl(const std::string &path) : path_(path) { std::ifstream file(path_); + if (!file) { + configJson_ = nlohmann::json::parse(R"( + { + "files": [] + } + )"); + return; + } configJson_ = nlohmann::json::parse(file); } diff --git a/ui/MainView.slint b/ui/MainView.slint index 516073e..5b3db7a 100644 --- a/ui/MainView.slint +++ b/ui/MainView.slint @@ -63,6 +63,10 @@ export component MainView inherits Rectangle { VerticalLayout { alignment: start; spacing: 16px; + if Backend.visible_tasks.length == 0 : VText { + text: "There is no task to show"; + horizontal-alignment: center; + } for day[dayIndex] in Backend.visible_tasks: VerticalLayout { Rectangle { background: Palette.card-background;