fix: attach room / event metadata to new token click construct uses on messages (#5607)
This commit is contained in:
parent
53091cf4a6
commit
8088b6a605
2 changed files with 3 additions and 6 deletions
|
|
@ -7,9 +7,7 @@ import 'package:matrix/matrix.dart';
|
|||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/construct_use_model.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/construct_use_type_enum.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/constructs_model.dart';
|
||||
import 'package:fluffychat/pangea/analytics_misc/learning_skills_enum.dart';
|
||||
import 'package:fluffychat/pangea/constructs/construct_level_enum.dart';
|
||||
import 'package:fluffychat/pangea/events/event_wrappers/pangea_message_event.dart';
|
||||
import 'package:fluffychat/pangea/events/models/pangea_token_model.dart';
|
||||
|
|
@ -26,10 +24,7 @@ class LemmaUseExampleMessages extends StatelessWidget {
|
|||
Future<List<ExampleMessage>> _getExampleMessages() async {
|
||||
final List<ExampleMessage> examples = [];
|
||||
for (final OneConstructUse use in construct.cappedUses) {
|
||||
if (use.useType.skillsEnumType != LearningSkillsEnum.writing ||
|
||||
use.metadata.eventId == null ||
|
||||
use.form == null ||
|
||||
use.xp <= 0) {
|
||||
if (use.metadata.eventId == null || use.form == null || use.xp <= 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -222,6 +222,8 @@ class MessageOverlayController extends State<MessageSelectionOverlay>
|
|||
"word-zoom-card-${token.text.uniqueKey}",
|
||||
token,
|
||||
Matrix.of(context).analyticsDataService,
|
||||
roomId: event.room.id,
|
||||
eventId: event.eventId,
|
||||
).then((_) {
|
||||
if (mounted) setState(() {});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue