Skip to content

Commit ffb08ff

Browse files
authored
fix: remove analytics from memory on logout (#1786)
1 parent 08126fd commit ffb08ff

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

lib/pangea/analytics_misc/construct_list_model.dart

+1-10
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,13 @@ import 'package:fluffychat/pangea/morphs/get_grammar_copy.dart';
1515
/// A wrapper around a list of [OneConstructUse]s, used to simplify
1616
/// the process of filtering / sorting / displaying the events.
1717
class ConstructListModel {
18-
void dispose() {
19-
_constructMap = {};
20-
_constructList = [];
21-
prevXP = 0;
22-
totalXP = 0;
23-
level = 0;
24-
_uses.clear();
25-
}
26-
2718
final List<OneConstructUse> _uses = [];
2819
List<OneConstructUse> get uses => _uses;
2920
List<OneConstructUse> get truncatedUses => _uses.take(100).toList();
3021

3122
/// A map of lemmas to ConstructUses, each of which contains a lemma
3223
/// key = lemma + constructType.string, value = ConstructUses
33-
Map<String, ConstructUses> _constructMap = {};
24+
final Map<String, ConstructUses> _constructMap = {};
3425

3526
/// Storing this to avoid re-running the sort operation each time this needs to
3627
/// be accessed. It contains the same information as _constructMap, but sorted.

lib/pangea/analytics_misc/get_analytics_controller.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class GetAnalyticsController extends BaseController {
117117
/// Clear all cached analytics data.
118118
@override
119119
void dispose() {
120-
constructListModel.dispose();
120+
constructListModel = ConstructListModel(uses: []);
121121
_analyticsUpdateSubscription?.cancel();
122122
_analyticsUpdateSubscription = null;
123123
_joinSpaceSubscription?.cancel();

0 commit comments

Comments
 (0)