From e0afa2fa79689af7642c169ddc9fa0d002eeb989 Mon Sep 17 00:00:00 2001 From: toki Date: Fri, 5 Jun 2026 14:32:00 +0900 Subject: [PATCH] =?UTF-8?q?fix(mobile):=20=EC=9B=B9=20=ED=94=84=EB=A6=AC?= =?UTF-8?q?=EB=B7=B0=20=EB=B6=80=ED=8A=B8=EC=8A=A4=ED=8A=B8=EB=9E=A9?= =?UTF-8?q?=EC=9D=84=20=EC=95=88=EC=A0=95=ED=99=94=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/client/lib/src/app/bootstrap.dart | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/apps/client/lib/src/app/bootstrap.dart b/apps/client/lib/src/app/bootstrap.dart index b63d04f..3c8ebf5 100644 --- a/apps/client/lib/src/app/bootstrap.dart +++ b/apps/client/lib/src/app/bootstrap.dart @@ -1,4 +1,5 @@ import 'package:firebase_core/firebase_core.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -9,9 +10,7 @@ import '../integrations/proto_socket/proto_socket_endpoint_config.dart'; import '../integrations/proto_socket/proto_socket_lifecycle.dart'; import 'nomadcode_client_app.dart'; -final _mattermostHost = MattermostPushHostIntegration( - pushClient: MattermostPushPluginClient(), -); +MattermostPushHostIntegration? _mattermostHost; final _navigatorKey = GlobalKey(); /// proto-socket lifecycle wired with the concrete connector. Bootstrap does @@ -21,6 +20,12 @@ final _protoSocketLifecycle = ProtoSocketLifecycle( ); ProtoSocketEndpointConfig? _protoSocketConfig; +MattermostPushHostIntegration _ensureMattermostHost() { + return _mattermostHost ??= MattermostPushHostIntegration( + pushClient: MattermostPushPluginClient(), + ); +} + Future applyFullscreenMode() async { await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky); SystemChrome.setSystemUIOverlayStyle( @@ -34,8 +39,10 @@ Future applyFullscreenMode() async { Future bootstrapNomadCodeClient() async { await applyFullscreenMode(); - await Firebase.initializeApp(); - await _mattermostHost.initialize(); + if (!kIsWeb) { + await Firebase.initializeApp(); + await _ensureMattermostHost().initialize(); + } _protoSocketConfig = ProtoSocketEndpointConfig.fromEnv(const {}); }