mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-08 08:04:08 +02:00
Added display of toast with potential human-readable errors from server.
This commit is contained in:
parent
c9a976bf87
commit
d9f397ea3f
2 changed files with 6 additions and 0 deletions
|
@ -85,6 +85,7 @@ struct StatisticalChart {
|
||||||
struct StatisticalGraph final {
|
struct StatisticalGraph final {
|
||||||
StatisticalChart chart;
|
StatisticalChart chart;
|
||||||
QString zoomToken;
|
QString zoomToken;
|
||||||
|
QString error;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct StatisticalValue final {
|
struct StatisticalValue final {
|
||||||
|
|
|
@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "lang/lang_keys.h"
|
#include "lang/lang_keys.h"
|
||||||
#include "main/main_session.h"
|
#include "main/main_session.h"
|
||||||
#include "statistics/chart_widget.h"
|
#include "statistics/chart_widget.h"
|
||||||
|
#include "ui/toast/toast.h"
|
||||||
#include "ui/layers/generic_box.h"
|
#include "ui/layers/generic_box.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -37,6 +38,10 @@ void StatisticsBox(not_null<Ui::GenericBox*> box, not_null<PeerData*> peer) {
|
||||||
const Data::StatisticalGraph &graph) {
|
const Data::StatisticalGraph &graph) {
|
||||||
if (graph.chart) {
|
if (graph.chart) {
|
||||||
widget->setZoomedChartData(graph.chart);
|
widget->setZoomedChartData(graph.chart);
|
||||||
|
} else if (!graph.error.isEmpty()) {
|
||||||
|
Ui::Toast::Show(
|
||||||
|
box->uiShow()->toastParent(),
|
||||||
|
graph.error);
|
||||||
}
|
}
|
||||||
}, [=](const QString &error) {
|
}, [=](const QString &error) {
|
||||||
}, [=] {
|
}, [=] {
|
||||||
|
|
Loading…
Add table
Reference in a new issue