tweaks for logic for showing message click instructions when the user sees the first message

pull/1423/head
ggurdin 1 year ago
parent 3e92c46328
commit 9dfece83ee
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -46,11 +46,16 @@ class ChatEventList extends StatelessWidget {
// after the chat event list mounts, if the user hasn't yet seen this instruction
// card, attach it on top of the first shown message
WidgetsBinding.instance.addPostFrameCallback((_) {
if (events.isEmpty) return;
final msgEvents = events
.where(
(event) => event.type == EventTypes.Message,
)
.toList();
if (msgEvents.isEmpty) return;
controller.pangeaController.instructions.showInstructionsPopup(
context,
InstructionsEnum.clickMessage,
events[0].eventId,
msgEvents[0].eventId,
true,
);
});

@ -69,6 +69,12 @@ class InstructionsController {
String transformTargetKey, [
bool showToggle = true,
]) async {
final bool userLangsSet =
await _pangeaController.userController.areUserLanguagesSet;
if (!userLangsSet) {
return;
}
if (_instructionsShown[key.toString()] ?? false) {
return;
}
@ -85,12 +91,6 @@ class InstructionsController {
return;
}
final bool userLangsSet =
await _pangeaController.userController.areUserLanguagesSet;
if (!userLangsSet) {
return;
}
final botStyle = BotStyle.text(context);
Future.delayed(
const Duration(seconds: 1),

Loading…
Cancel
Save