added robot animation and message to instruct user to wait after too … (#2415)
* added robot animation and message to instruct user to wait after too many join with code attempts * chore: formatting * replaced hardcoded text with intl_en.arb * Resolving missing import * generated * chore: formatting --------- Co-authored-by: ggurdin <ggurdin@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
93e6e30457
commit
184442a5ff
2 changed files with 52 additions and 9 deletions
|
|
@ -4859,5 +4859,7 @@
|
|||
"publicSpacesTitle": "Learning communities",
|
||||
"askToJoin": "Ask to join",
|
||||
"emptyChatWarningTitle": "Chat is empty",
|
||||
"emptyChatWarningDesc": "You haven't invited anyone to your chat. Go to Chat settings to invite your contacts or the Bot. You can also do this later."
|
||||
"emptyChatWarningDesc": "You haven't invited anyone to your chat. Go to Chat settings to invite your contacts or the Bot. You can also do this later.",
|
||||
"areYouLikeMe": "Are you like me?",
|
||||
"tryAgainLater": "Too many attempts made. Please try again in 5 minutes."
|
||||
}
|
||||
|
|
@ -16,12 +16,13 @@ import 'package:fluffychat/pangea/common/utils/error_handler.dart';
|
|||
import 'package:fluffychat/pangea/common/utils/firebase_analytics.dart';
|
||||
import 'package:fluffychat/widgets/future_loading_dialog.dart';
|
||||
import 'package:fluffychat/widgets/matrix.dart';
|
||||
import '../../bot/widgets/bot_face_svg.dart';
|
||||
import '../../common/controllers/base_controller.dart';
|
||||
|
||||
class ClassController extends BaseController {
|
||||
late PangeaController _pangeaController;
|
||||
|
||||
//Storage Initialization
|
||||
// Storage Initialization
|
||||
final GetStorage chatBox = GetStorage("chat_list_storage");
|
||||
final GetStorage linkBox = GetStorage("link_storage");
|
||||
static final GetStorage _classStorage = GetStorage('class_storage');
|
||||
|
|
@ -121,7 +122,8 @@ class ClassController extends BaseController {
|
|||
);
|
||||
|
||||
if (knockResponse.statusCode == 429) {
|
||||
throw L10n.of(context).tooManyRequest;
|
||||
await _showTooManyRequestsPopup(context);
|
||||
return null;
|
||||
}
|
||||
if (knockResponse.statusCode != 200) {
|
||||
throw notFoundError ?? L10n.of(context).unableToFindClass;
|
||||
|
|
@ -197,12 +199,51 @@ class ClassController extends BaseController {
|
|||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// P-EPIC
|
||||
// prereq - server needs ability to invite to private room. how?
|
||||
// does server api have ability with admin token?
|
||||
// is application service needed?
|
||||
// BE - check class code and if class code is correct, invite student to room
|
||||
// FE - look for invite from room and automatically accept
|
||||
Future<void> _showTooManyRequestsPopup(BuildContext context) async {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Dialog(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const BotFace(
|
||||
width: 100,
|
||||
expression: BotExpression.idle,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
// "Are you like me?",
|
||||
L10n.of(context).areYouLikeMe,
|
||||
style: Theme.of(context).textTheme.titleLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
// "Too many attempts made. Please try again in 5 minutes.",
|
||||
L10n.of(context).tryAgainLater,
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
child: const Text("Close"),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue