diff options
| author | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-23 21:47:11 +0300 |
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-09-23 22:12:24 +0300 |
| commit | a1eb7144f5e226264cb6bc9f3545456a8de3ec78 (patch) | |
| tree | 634b15a0e79079bb4b4c9f32d8c2bca69a2a1006 /indra | |
| parent | d7bd769129100332791569cbffa07f54d2fca991 (diff) | |
SL-20598 Fix user not being able to reset display name
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterdisplayname.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/indra/newview/llfloaterdisplayname.cpp b/indra/newview/llfloaterdisplayname.cpp index 236aadfbc1..4843a48e66 100644 --- a/indra/newview/llfloaterdisplayname.cpp +++ b/indra/newview/llfloaterdisplayname.cpp @@ -56,6 +56,7 @@ private: void onCacheSetName(bool success, const std::string& reason, const LLSD& content); + bool mIsLockedOut = false; }; LLFloaterDisplayName::LLFloaterDisplayName(const LLSD& key) : @@ -72,8 +73,8 @@ void LLFloaterDisplayName::onOpen(const LLSD& key) LLAvatarNameCache::get(gAgent.getID(), &av_name); F64 now_secs = LLDate::now().secondsSinceEpoch(); - - if (now_secs < av_name.mNextUpdate) + mIsLockedOut = now_secs < av_name.mNextUpdate; + if (mIsLockedOut) { // ...can't update until some time in the future F64 next_update_local_secs = @@ -167,18 +168,19 @@ void LLFloaterDisplayName::onReset() } getChild<LLUICtrl>("display_name_editor")->setValue(av_name.getUserName()); - if (getChild<LLUICtrl>("display_name_editor")->getEnabled()) + if (mIsLockedOut) { - // UI is enabled, fill the first field - getChild<LLUICtrl>("display_name_confirm")->clear(); - getChild<LLUICtrl>("display_name_confirm")->setFocus(true); + // UI is disabled. + // We should allow resetting even if user already + // set a display name, enable save button + getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName()); + getChild<LLUICtrl>("save_btn")->setEnabled(true); } else { - // UI is disabled, looks like we should allow resetting - // even if user already set a display name, enable save button - getChild<LLUICtrl>("display_name_confirm")->setValue(av_name.getUserName()); - getChild<LLUICtrl>("save_btn")->setEnabled(true); + // UI is enabled, focus on the confirm field + getChild<LLUICtrl>("display_name_confirm")->clear(); + getChild<LLUICtrl>("display_name_confirm")->setFocus(true); } } |
