mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-03-31 07:52:06 +00:00
fixed settings on restart
This commit is contained in:
parent
b4427a0073
commit
12ff311114
@ -207,7 +207,7 @@ void UsernameBox::onUpdateDone(const MTPUser &user) {
|
||||
bool UsernameBox::onUpdateFail(const RPCError &error) {
|
||||
_saveRequest = 0;
|
||||
QString err(error.type()), name = getName();
|
||||
if (err == "USERNAME_NOT_MODIFIED") {
|
||||
if (err == "USERNAME_NOT_MODIFIED" || _sentUsername == textOneLine(name)) {
|
||||
App::self()->setName(textOneLine(App::self()->firstName), textOneLine(App::self()->lastName), textOneLine(App::self()->nameOrPhone), textOneLine(name));
|
||||
emit closed();
|
||||
return true;
|
||||
|
@ -97,6 +97,8 @@ bool scaleIs(DBIScale scale) {
|
||||
}
|
||||
|
||||
SettingsInner::SettingsInner(SettingsWidget *parent) : QWidget(parent),
|
||||
_self(App::self()),
|
||||
|
||||
// profile
|
||||
_nameCache(self() ? self()->name : QString()),
|
||||
_uploadPhoto(this, lang(lng_settings_upload), st::btnSetUpload),
|
||||
|
@ -147,8 +147,9 @@ private:
|
||||
|
||||
void setScale(DBIScale newScale);
|
||||
|
||||
UserData *_self;
|
||||
UserData *self() const {
|
||||
return App::self();
|
||||
return App::self() ? _self : static_cast<UserData*>(0);
|
||||
}
|
||||
int32 _left;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user