mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Added refreshing of list in CountrySelectBox on update.
This commit is contained in:
@@ -262,6 +262,7 @@ void CountriesInstance::setList(std::vector<Info> &&infos) {
|
||||
_list = std::move(infos);
|
||||
_byCode.clear();
|
||||
_byISO2.clear();
|
||||
_updated.fire({});
|
||||
}
|
||||
|
||||
const CountriesInstance::Map &CountriesInstance::byCode() {
|
||||
@@ -454,6 +455,10 @@ FormatResult CountriesInstance::format(FormatArgs args) {
|
||||
};
|
||||
}
|
||||
|
||||
rpl::producer<> CountriesInstance::updated() const {
|
||||
return _updated.events();
|
||||
}
|
||||
|
||||
CountriesInstance &Instance() {
|
||||
return SingleInstance;
|
||||
}
|
||||
|
||||
@@ -55,12 +55,16 @@ public:
|
||||
|
||||
[[nodiscard]] FormatResult format(FormatArgs args);
|
||||
|
||||
[[nodiscard]] rpl::producer<> updated() const;
|
||||
|
||||
private:
|
||||
std::vector<Info> _list;
|
||||
|
||||
Map _byCode;
|
||||
Map _byISO2;
|
||||
|
||||
rpl::event_stream<> _updated;
|
||||
|
||||
};
|
||||
|
||||
CountriesInstance &Instance();
|
||||
|
||||
Reference in New Issue
Block a user