Вход в каналы по ссылке, клоки отупел
This commit is contained in:
@@ -1027,7 +1027,7 @@ class _ChatsScreenState extends State<ChatsScreen>
|
||||
color: Theme.of(context).colorScheme.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
title: const Text('Присоединиться к группе'),
|
||||
title: const Text('Присоединиться по ссылке'),
|
||||
subtitle: const Text('По ссылке-приглашению'),
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
|
||||
@@ -55,6 +55,28 @@ class _JoinGroupScreenState extends State<JoinGroupScreen> {
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
// Обработка успешной подписки на канал (opcode 57)
|
||||
if (message['cmd'] == 1 && message['opcode'] == 57) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: const Text('Успешно подписались на канал!'),
|
||||
backgroundColor: Colors.green,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
behavior: SnackBarBehavior.floating,
|
||||
margin: const EdgeInsets.all(10),
|
||||
),
|
||||
);
|
||||
|
||||
Navigator.of(context).pop();
|
||||
}
|
||||
|
||||
// Обработка ошибки подписки на канал (opcode 57)
|
||||
if (message['cmd'] == 3 && message['opcode'] == 57) {
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
|
||||
@@ -108,7 +108,7 @@ class CustomThemePreset {
|
||||
CustomThemePreset({
|
||||
required this.id,
|
||||
required this.name,
|
||||
this.appTheme = AppTheme.system,
|
||||
this.appTheme = AppTheme.dark,
|
||||
this.accentColor = Colors.blue,
|
||||
this.useCustomChatWallpaper = false,
|
||||
this.chatWallpaperType = ChatWallpaperType.solid,
|
||||
|
||||
Reference in New Issue
Block a user