Fix total_pages == 0 bug

This commit is contained in:
2022-09-30 23:27:07 +06:00
parent 3c551afe43
commit ae56c2a4a2
3 changed files with 64 additions and 51 deletions

View File

@@ -163,9 +163,9 @@ where
};
if items_page.total_pages == 0 {
match bot.send_message(chat_id, "Книги не найдены!").send().await {
Ok(_) => (),
Err(err) => return Err(Box::new(err)),
return match bot.send_message(chat_id, "Книги не найдены!").send().await {
Ok(_) => Ok(()),
Err(err) => Err(Box::new(err)),
};
};
@@ -246,9 +246,9 @@ where
};
if items_page.total_pages == 0 {
match bot.send_message(chat_id, "Книги не найдены!").send().await {
Ok(_) => (),
Err(err) => return Err(Box::new(err)),
return match bot.send_message(chat_id, "Книги не найдены!").send().await {
Ok(_) => Ok(()),
Err(err) => Err(Box::new(err)),
};
};