fix: щавель виноград, ебырь омайгад
This commit is contained in:
@@ -5,7 +5,7 @@ abstract class ServerConfig {
|
||||
static const int defaultPort = 443;
|
||||
static const String prefHostKey = 'server_host_override';
|
||||
static const String prefPortKey = 'server_port_override';
|
||||
static const Duration pingInterval = Duration(seconds: 30);
|
||||
static const Duration pingInterval = Duration(seconds: 10);
|
||||
static const Duration requestTimeout = Duration(seconds: 30);
|
||||
static const int maxReconnectAttempts = 50;
|
||||
|
||||
|
||||
@@ -83,6 +83,15 @@ String messageFromErrorPayload(dynamic payload) {
|
||||
return s.isNotEmpty ? s : 'Неизвестная ошибка';
|
||||
}
|
||||
|
||||
bool isSessionStateError(Object error) {
|
||||
if (error is SessionExpiredException) return true;
|
||||
final text = error.toString().toLowerCase();
|
||||
return text.contains('состояние сессии') ||
|
||||
text.contains('сессия не найдена') ||
|
||||
text.contains('авторизационная сессия') ||
|
||||
text.contains('сессия не онлайн');
|
||||
}
|
||||
|
||||
/// Payload меньше этого размера отправляется без сжатия (как в оригинале).
|
||||
const int _compressionThreshold = 32;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user