Reuse default_result.

This commit is contained in:
levlam 2023-02-17 16:06:38 +03:00
parent 6cf6f32418
commit 3fef62a396

View File

@ -1596,13 +1596,13 @@ void LinkManager::get_external_link_info(string &&link, Promise<td_api::object_p
} }
if (autologin_update_time_ < Time::now() - 10000) { if (autologin_update_time_ < Time::now() - 10000) {
auto query_promise = auto query_promise = PromiseCreator::lambda([link = std::move(link), default_result = std::move(default_result),
PromiseCreator::lambda([link = std::move(link), promise = std::move(promise)](Result<Unit> &&result) mutable { promise = std::move(promise)](Result<Unit> &&result) mutable {
if (result.is_error()) { if (result.is_error()) {
return promise.set_value(td_api::make_object<td_api::loginUrlInfoOpen>(link, false)); return promise.set_value(std::move(default_result));
} }
send_closure(G()->link_manager(), &LinkManager::get_external_link_info, std::move(link), std::move(promise)); send_closure(G()->link_manager(), &LinkManager::get_external_link_info, std::move(link), std::move(promise));
}); });
return send_closure(G()->config_manager(), &ConfigManager::reget_app_config, std::move(query_promise)); return send_closure(G()->config_manager(), &ConfigManager::reget_app_config, std::move(query_promise));
} }