replaced account data singleton with a session model
This commit is contained in:
@@ -4,7 +4,7 @@ import 'dart:developer';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/account_data.dart';
|
||||
import '../session/session_manager.dart';
|
||||
import '../state/app/modules/timetable/bloc/timetable_state.dart';
|
||||
import '../storage/settings.dart';
|
||||
import 'widget_data_mapper.dart';
|
||||
@@ -48,7 +48,7 @@ class WidgetPublisher {
|
||||
bool isTeacher = false,
|
||||
int? epoch,
|
||||
}) {
|
||||
final sessionEpoch = epoch ?? AccountData().sessionEpoch;
|
||||
final sessionEpoch = epoch ?? SessionManager().sessionEpoch;
|
||||
return _queue = _queue.then(
|
||||
(_) => _publish(
|
||||
state,
|
||||
@@ -65,7 +65,7 @@ class WidgetPublisher {
|
||||
required bool isTeacher,
|
||||
required int epoch,
|
||||
}) async {
|
||||
if (!AccountData().isCurrentSession(epoch)) return;
|
||||
if (!SessionManager().isCurrentSession(epoch)) return;
|
||||
try {
|
||||
final connectDouble =
|
||||
settings?.timetableSettings.connectDoubleLessons ?? true;
|
||||
@@ -106,7 +106,7 @@ class WidgetPublisher {
|
||||
);
|
||||
// A publish still running at sign-out would put the previous account's
|
||||
// plan back onto the just cleared widget.
|
||||
if (!AccountData().isCurrentSession(epoch)) return;
|
||||
if (!SessionManager().isCurrentSession(epoch)) return;
|
||||
// Most bloc emits (week swipes, prefetches) don't touch the widget's
|
||||
// window; skip the SharedPreferences commits and widget re-render then.
|
||||
final signature = jsonEncode([
|
||||
|
||||
Reference in New Issue
Block a user