fix(token-order): global has settings check that introduced side effects

The "settings exist" done via ManageTokensController::hasSettings() was
using the global store, hence not working user based. Therefore, after
an onboarding the previous user's settings presence was taken into account.
The fix now uses the order data that is loaded externally per user.

Closes #14383
This commit is contained in:
Stefan 2024-04-14 11:07:34 +02:00 committed by Stefan Dunca
parent 228622359d
commit 8be1453fd0
2 changed files with 2 additions and 4 deletions

View File

@ -276,9 +276,7 @@ QString ManageTokensController::settingsGroupName() const
bool ManageTokensController::hasSettings() const
{
Q_ASSERT(!m_settingsKey.isEmpty());
const auto groups = m_settings.childGroups();
return groups.contains(settingsGroupName());
return !m_settingsData.isEmpty();
}
int ManageTokensController::compareTokens(const QString& lhsSymbol, const QString& rhsSymbol) const

View File

@ -160,7 +160,7 @@ private:
void setSerializeAsCollectibles(const bool newSerializeAsCollectibles);
QSettings m_settings;
SerializedTokenData m_settingsData; // symbol -> {sortOrder, visible, groupId, isCommunityGroup, isCollectionGroup}
SerializedTokenData m_settingsData;
bool hasSettings() const;
void loadSettingsData(bool withGroup = false);