mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-22 06:50:19 +00:00
fix(amm): avoid duplicate wallet context refreshes
This commit is contained in:
parent
a66ffddfe4
commit
72bde7af6e
@ -85,7 +85,6 @@ AmmUiBackend::AmmUiBackend(LogosAPI* logosAPI, QObject* parent)
|
|||||||
connect(m_walletController.get(), &WalletController::stateChanged,
|
connect(m_walletController.get(), &WalletController::stateChanged,
|
||||||
this, &AmmUiBackend::syncWalletState);
|
this, &AmmUiBackend::syncWalletState);
|
||||||
syncWalletState();
|
syncWalletState();
|
||||||
refreshNewPositionContext({});
|
|
||||||
m_walletController->start();
|
m_walletController->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,31 +97,22 @@ WalletAccountModel* AmmUiBackend::accountModel() const
|
|||||||
|
|
||||||
QString AmmUiBackend::createNewDefault(QString password)
|
QString AmmUiBackend::createNewDefault(QString password)
|
||||||
{
|
{
|
||||||
const QString mnemonic = m_walletController->createDefaultWallet(password);
|
return m_walletController->createDefaultWallet(password);
|
||||||
syncWalletState();
|
|
||||||
return mnemonic;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AmmUiBackend::createNew(QString configPath, QString storagePath, QString password)
|
QString AmmUiBackend::createNew(QString configPath, QString storagePath, QString password)
|
||||||
{
|
{
|
||||||
const QString mnemonic =
|
return m_walletController->createWallet(configPath, storagePath, password);
|
||||||
m_walletController->createWallet(configPath, storagePath, password);
|
|
||||||
syncWalletState();
|
|
||||||
return mnemonic;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AmmUiBackend::openExisting()
|
bool AmmUiBackend::openExisting()
|
||||||
{
|
{
|
||||||
const bool opened = m_walletController->open();
|
return m_walletController->open();
|
||||||
syncWalletState();
|
|
||||||
return opened;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AmmUiBackend::disconnectWallet()
|
void AmmUiBackend::disconnectWallet()
|
||||||
{
|
{
|
||||||
m_walletController->disconnect();
|
m_walletController->disconnect();
|
||||||
m_newPosition->clearWalletAccounts();
|
|
||||||
refreshNewPositionContext(QVariantMap());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AmmUiBackend::createAccountPublic()
|
QString AmmUiBackend::createAccountPublic()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user