Ask to unlock Telegram before saving theme.

This commit is contained in:
John Preston 2019-09-09 20:26:53 +03:00
parent f90fdce422
commit cd5ef069c0
2 changed files with 5 additions and 1 deletions

View file

@ -1613,6 +1613,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_theme_editor_error" = "The editor encountered an error :( See 'log.txt' for details.";
"lng_theme_editor_sure_close" = "Are you sure you want to close the editor? Your changes won't be saved.";
"lng_theme_editor_need_auth" = "You need to log in to save your theme.";
"lng_theme_editor_need_unlock" = "You need to unlock Telegram to save your theme.";
"lng_theme_editor_done" = "Theme exported successfully!";
"lng_theme_editor_title" = "Edit color palette";
"lng_theme_editor_export_button" = "Export theme";

View file

@ -739,7 +739,10 @@ QByteArray Editor::ColorizeInContent(
}
void Editor::save() {
if (!_window->account().sessionExists()) {
if (Core::App().passcodeLocked()) {
Ui::Toast::Show(tr::lng_theme_editor_need_unlock(tr::now));
return;
} else if (!_window->account().sessionExists()) {
Ui::Toast::Show(tr::lng_theme_editor_need_auth(tr::now));
return;
} else if (_saving) {