fixed stale state after logout and replayed or lost share intents
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:developer';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../model/account_data.dart';
|
||||
import '../state/app/modules/timetable/bloc/timetable_state.dart';
|
||||
import '../storage/settings.dart';
|
||||
import 'widget_data_mapper.dart';
|
||||
@@ -24,6 +25,7 @@ class WidgetPublisher {
|
||||
Settings? settings,
|
||||
bool isTeacher = false,
|
||||
}) async {
|
||||
final epoch = AccountData().sessionEpoch;
|
||||
try {
|
||||
final connectDouble =
|
||||
settings?.timetableSettings.connectDoubleLessons ?? true;
|
||||
@@ -58,6 +60,9 @@ class WidgetPublisher {
|
||||
connectDoubleLessons: connectDouble,
|
||||
showClassInsteadOfTeacher: isTeacher,
|
||||
);
|
||||
// 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;
|
||||
await WidgetSync.writeDayData(dayData);
|
||||
await WidgetSync.writeWeekData(weekData);
|
||||
await WidgetSync.setLoggedIn(true);
|
||||
|
||||
Reference in New Issue
Block a user