From cec8d1c4b73d009aa1f124b9b5d33e20a6669b57 Mon Sep 17 00:00:00 2001 From: blankie Date: Tue, 2 May 2023 15:48:45 +0700 Subject: [PATCH] Hide grid of illustrations if there aren't any --- routes/tags.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routes/tags.cpp b/routes/tags.cpp index 3fa34de..5a51350 100644 --- a/routes/tags.cpp +++ b/routes/tags.cpp @@ -43,10 +43,12 @@ void tags_route(const httplib::Request& req, httplib::Response& res, const Confi } Element body("body", { - generate_header(req, config, search_results, query, tags, order, search_suggestions), - Element("br"), - generate_illusts_pager(req, config, search_results.illusts, page, "illusts") + generate_header(req, config, search_results, query, tags, order, search_suggestions) }); + if (!search_results.illusts.illusts.empty()) { + body.nodes.push_back(Element("br")); + body.nodes.push_back(generate_illusts_pager(req, config, search_results.illusts, page, "illusts")); + } serve(req, res, config, tags_to_string(std::move(search_results.tag_translations), std::move(tags)), std::move(body)); }