tweaks for logic for showing message click instructions when the user sees the first message
This commit is contained in:
parent
3e92c46328
commit
9dfece83ee
2 changed files with 13 additions and 8 deletions
|
|
@ -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…
Add table
Reference in a new issue