Add "Terms of Use" menu item to all miniapps.

This commit is contained in:
John Preston 2024-03-20 16:59:10 +04:00
parent fa02e521f9
commit 9d0457d208
2 changed files with 4 additions and 0 deletions

View file

@ -2883,6 +2883,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_bot_remove_from_side_menu_done" = "Bot removed from the main menu.";
"lng_bot_settings" = "Settings";
"lng_bot_open" = "Open Bot";
"lng_bot_terms" = "Terms of Use";
"lng_bot_reload_page" = "Reload Page";
"lng_bot_add_to_menu" = "{bot} asks your permission to be added as an option to your attachments menu so you can access it from any chat.";
"lng_bot_add_to_menu_done" = "Bot added to the menu.";

View file

@ -525,6 +525,9 @@ bool Panel::showWebview(
_webview->window.navigate(url);
}
}, &st::menuIconRestore);
callback(tr::lng_bot_terms(tr::now), [=] {
File::OpenUrl(tr::lng_mini_apps_tos_url(tr::now));
}, &st::menuIconGroupLog);
const auto main = (_menuButtons & MenuButton::RemoveFromMainMenu);
if (main || (_menuButtons & MenuButton::RemoveFromMenu)) {
const auto handler = [=] {