TF-3603: Integrate Cozy features
TF-3603 [TEMP] expose Cozy integration result to console.log
This commit is contained in:
@@ -78,4 +78,6 @@ class AppConfig {
|
||||
static bool get isSaasPlatForm => _platformEnv.toLowerCase() == saasPlatform;
|
||||
|
||||
static bool get isWebSocketEchoPingEnabled => dotenv.get('WS_ECHO_PING', fallback: 'false') == 'true';
|
||||
|
||||
static bool get isCozyIntegrationEnabled => dotenv.get('COZY_INTEGRATION', fallback: 'false') == 'true';
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:core/utils/app_logger.dart';
|
||||
import 'package:core/utils/platform_info.dart';
|
||||
import 'package:cozy/cozy_config_manager/cozy_config_manager.dart';
|
||||
import 'package:tmail_ui_user/main/utils/app_config.dart';
|
||||
|
||||
class CozyIntegration {
|
||||
const CozyIntegration._();
|
||||
|
||||
static Future<void> integrateCozy() async {
|
||||
if (!PlatformInfo.isWeb || !AppConfig.isCozyIntegrationEnabled) return;
|
||||
|
||||
try {
|
||||
final cozyConfig = CozyConfigManager();
|
||||
await cozyConfig.injectCozyScript();
|
||||
await cozyConfig.initialize();
|
||||
} catch (e) {
|
||||
logError('CozyIntegration::integrateCozy:Exception = $e');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user