mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Added toast when limit for note length is reached.
This commit is contained in:
@@ -4802,6 +4802,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
"lng_contact_phone_will_be_shared" = "You can make your phone visible to {user}.";
|
||||
"lng_contact_add_notes" = "Note";
|
||||
"lng_contact_add_notes_about" = "Notes are only visible to you.";
|
||||
"lng_contact_notes_limit_reached#one" = "You've reached the contact note limit. Please make the note shorter by {count} character.";
|
||||
"lng_contact_notes_limit_reached#other" = "You've reached the contact note limit. Please make the note shorter by {count} characters.";
|
||||
"lng_suggest_photo_for" = "Suggest Photo for {user}";
|
||||
"lng_suggest_birthday" = "Suggest Date of Birth";
|
||||
"lng_suggest_birthday_box_title" = "{user}'s Date of Birth";
|
||||
|
||||
@@ -258,6 +258,22 @@ void Controller::initNameFields(
|
||||
(inverted ? last : first)->showError();
|
||||
return;
|
||||
}
|
||||
|
||||
if (_notesField) {
|
||||
const auto limit = Data::PremiumLimits(
|
||||
&_user->session()).contactNoteLengthCurrent();
|
||||
const auto remove = Ui::ComputeFieldCharacterCount(_notesField)
|
||||
- limit;
|
||||
if (remove > 0) {
|
||||
_box->showToast(tr::lng_contact_notes_limit_reached(
|
||||
tr::now,
|
||||
lt_count,
|
||||
remove));
|
||||
_notesField->setFocus();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const auto user = _user;
|
||||
const auto personal = _updatedPersonalPhoto
|
||||
? _updatedPersonalPhoto()
|
||||
|
||||
Reference in New Issue
Block a user