fix: remove analytics from memory on logout (#1786)
This commit is contained in:
parent
08126fd38b
commit
ffb08ff336
2 changed files with 2 additions and 11 deletions
|
|
@ -15,22 +15,13 @@ import 'package:fluffychat/pangea/morphs/get_grammar_copy.dart';
|
|||
/// A wrapper around a list of [OneConstructUse]s, used to simplify
|
||||
/// the process of filtering / sorting / displaying the events.
|
||||
class ConstructListModel {
|
||||
void dispose() {
|
||||
_constructMap = {};
|
||||
_constructList = [];
|
||||
prevXP = 0;
|
||||
totalXP = 0;
|
||||
level = 0;
|
||||
_uses.clear();
|
||||
}
|
||||
|
||||
final List<OneConstructUse> _uses = [];
|
||||
List<OneConstructUse> get uses => _uses;
|
||||
List<OneConstructUse> get truncatedUses => _uses.take(100).toList();
|
||||
|
||||
/// A map of lemmas to ConstructUses, each of which contains a lemma
|
||||
/// key = lemma + constructType.string, value = ConstructUses
|
||||
Map<String, ConstructUses> _constructMap = {};
|
||||
final Map<String, ConstructUses> _constructMap = {};
|
||||
|
||||
/// Storing this to avoid re-running the sort operation each time this needs to
|
||||
/// be accessed. It contains the same information as _constructMap, but sorted.
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class GetAnalyticsController extends BaseController {
|
|||
/// Clear all cached analytics data.
|
||||
@override
|
||||
void dispose() {
|
||||
constructListModel.dispose();
|
||||
constructListModel = ConstructListModel(uses: []);
|
||||
_analyticsUpdateSubscription?.cancel();
|
||||
_analyticsUpdateSubscription = null;
|
||||
_joinSpaceSubscription?.cancel();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue