testing if issue with futures
This commit is contained in:
parent
8f474e34bf
commit
74b2f49891
4 changed files with 29 additions and 28 deletions
|
|
@ -754,7 +754,7 @@ class ChatListController extends State<ChatList>
|
|||
if (mounted) {
|
||||
GoogleAnalytics.analyticsUserUpdate(client.userID);
|
||||
await pangeaController.subscriptionController.initialize();
|
||||
pangeaController.afterSyncAndFirstLoginInitialization(context);
|
||||
await pangeaController.afterSyncAndFirstLoginInitialization(context);
|
||||
await pangeaController.inviteBotToExistingSpaces();
|
||||
} else {
|
||||
ErrorHandler.logError(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class ClassController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
void checkForClassCodeAndSubscription(BuildContext context) {
|
||||
Future<void> checkForClassCodeAndSubscription(BuildContext context) async {
|
||||
final String? classCode = _pangeaController.pStoreService.read(
|
||||
PLocalKey.cachedClassCodeToJoin,
|
||||
addClientIdToKey: false,
|
||||
|
|
@ -55,7 +55,7 @@ class ClassController extends BaseController {
|
|||
PLocalKey.cachedClassCodeToJoin,
|
||||
addClientIdToKey: false,
|
||||
);
|
||||
joinClasswithCode(
|
||||
await joinClasswithCode(
|
||||
context,
|
||||
classCode,
|
||||
).onError(
|
||||
|
|
@ -67,7 +67,7 @@ class ClassController extends BaseController {
|
|||
//question for gabby: why do we need this in two places?
|
||||
if (!_pangeaController.subscriptionController.isSubscribed) {
|
||||
print("Unsubscribed user in class_controller. Showing paywall.");
|
||||
_pangeaController.subscriptionController.showPaywall(context);
|
||||
await _pangeaController.subscriptionController.showPaywall(context);
|
||||
}
|
||||
} catch (err) {
|
||||
debugger(when: kDebugMode);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import 'dart:developer';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:fluffychat/pangea/choreographer/widgets/it_feedback_card.dart';
|
||||
import 'package:fluffychat/pangea/constants/class_default_values.dart';
|
||||
import 'package:fluffychat/pangea/controllers/class_controller.dart';
|
||||
import 'package:fluffychat/pangea/controllers/contextual_definition_controller.dart';
|
||||
|
|
@ -66,12 +65,12 @@ class PangeaController {
|
|||
_addRefInObjects();
|
||||
}
|
||||
|
||||
void afterSyncAndFirstLoginInitialization(BuildContext context) {
|
||||
classController.checkForClassCodeAndSubscription(context);
|
||||
|
||||
Future<void> afterSyncAndFirstLoginInitialization(
|
||||
BuildContext context,
|
||||
) async {
|
||||
await classController.checkForClassCodeAndSubscription(context);
|
||||
// startChatWithBotIfNotPresent();
|
||||
|
||||
classController.fixClassPowerLevels();
|
||||
await classController.fixClassPowerLevels();
|
||||
}
|
||||
|
||||
/// Initialize controllers
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ import 'package:fluffychat/pangea/network/requests.dart';
|
|||
import 'package:fluffychat/pangea/network/urls.dart';
|
||||
import 'package:fluffychat/pangea/utils/error_handler.dart';
|
||||
import 'package:fluffychat/pangea/utils/firebase_analytics.dart';
|
||||
import 'package:fluffychat/pangea/widgets/subscription/subscription_paywall.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
|
@ -145,25 +147,25 @@ class SubscriptionController extends BaseController {
|
|||
return;
|
||||
}
|
||||
if (!forceShow && isSubscribed) return;
|
||||
await showModalBottomSheet(
|
||||
// isScrollControlled: true,
|
||||
// useRootNavigator: !PlatformInfos.isMobile,
|
||||
// clipBehavior: Clip.hardEdge,
|
||||
showModalBottomSheet(
|
||||
isScrollControlled: true,
|
||||
useRootNavigator: !PlatformInfos.isMobile,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
context: context,
|
||||
// constraints: const BoxConstraints(
|
||||
// maxHeight: 600,
|
||||
// ),
|
||||
// builder: (_) {
|
||||
// try {
|
||||
// return SubscriptionPaywall(
|
||||
// pangeaController: _pangeaController,
|
||||
// );
|
||||
// } catch (err) {
|
||||
// print("error build modal bottom sheet: $err");
|
||||
// return const SizedBox.shrink();
|
||||
// }
|
||||
// },
|
||||
builder: (_) => const SizedBox.shrink(),
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 600,
|
||||
),
|
||||
builder: (_) {
|
||||
// try {
|
||||
return SubscriptionPaywall(
|
||||
pangeaController: _pangeaController,
|
||||
);
|
||||
// } catch (err) {
|
||||
// print("error build modal bottom sheet: $err");
|
||||
// return const SizedBox.shrink();
|
||||
// }
|
||||
},
|
||||
// builder: (_) => const SizedBox.shrink(),
|
||||
);
|
||||
} catch (e, s) {
|
||||
ErrorHandler.logError(e: e, s: s);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue