Commit 72be7463 authored by atraczyk's avatar atraczyk Committed by Adrien Béraud

account edition: fix username registration post account creation

Change-Id: Id48e9a72b3f67c353b237fc506a9a1e3eea09cae
parent 0d1dcc9f
......@@ -653,9 +653,7 @@ RingD::registerName(String^ accountId, String^ password, String^ username)
auto _password = Utils::toString(password);
auto _username = Utils::toString(username);
bool result;
result = DRing::registerName(_accountId, _password, _username);
DRing::registerName(_accountId, _password, _username);
});
}
......@@ -1109,6 +1107,7 @@ RingD::registerCallbacks()
bool res = state == 0;
Utils::runOnUIThread([this, res, account_id]() {
nameRegistered(res, Utils::toPlatformString(account_id));
mainPage->showLoadingOverlay(false, false);
});
if (!res)
return;
......
......@@ -937,9 +937,6 @@ void RingClientUWP::Views::SmartPanel::_acceptAccountModification__Click(Platfor
selectMenu(MenuOpen::ACCOUNTS_LIST);
updatePageContent();
if (_usernameValidEdition_->Visibility == Windows::UI::Xaml::Visibility::Visible && _usernameTextBoxEdition_->Text->Length() > 2)
RingD::instance->registerName(account->accountID_, "", _usernameTextBoxEdition_->Text);
}
......
......@@ -615,23 +615,29 @@ public:
task_queue(task_queue const& other) {}
void add_task(std::function<void()> const& task) {
std::lock_guard<std::mutex> lk(taskMutex_);
tasks_.push(task);
runOnWorkerThread([this, task]() {
std::lock_guard<std::mutex> lk(taskMutex_);
tasks_.push(task);
});
}
void dequeue_tasks() {
std::lock_guard<std::mutex> lk(taskMutex_);
while (!tasks_.empty()) {
auto f = tasks_.front();
f();
tasks_.pop();
}
runOnWorkerThread([this]() {
std::lock_guard<std::mutex> lk(taskMutex_);
while (!tasks_.empty()) {
auto f = tasks_.front();
f();
tasks_.pop();
}
});
}
void clear() {
std::lock_guard<std::mutex> lk(taskMutex_);
std::queue<std::function<void()>> empty;
std::swap(tasks_, empty);
runOnWorkerThread([this]() {
std::lock_guard<std::mutex> lk(taskMutex_);
std::queue<std::function<void()>> empty;
std::swap(tasks_, empty);
});
}
private:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment