fix: automate graduate timetable read and refine blue glass Dock
This commit is contained in:
@@ -22,7 +22,11 @@ class _SchoolAuthPageState extends State<SchoolAuthPage> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
widget.session.addListener(_changed);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => _changed());
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (!mounted) return;
|
||||
widget.session.setReadingActive(true);
|
||||
_changed();
|
||||
});
|
||||
}
|
||||
|
||||
void _changed() {
|
||||
@@ -80,6 +84,7 @@ class _SchoolAuthPageState extends State<SchoolAuthPage> {
|
||||
@override
|
||||
void dispose() {
|
||||
widget.session.removeListener(_changed);
|
||||
widget.session.setReadingActive(false);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -96,10 +101,8 @@ class _SchoolAuthPageState extends State<SchoolAuthPage> {
|
||||
icon: const Icon(Icons.refresh_rounded),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: '重试读取',
|
||||
onPressed: _saving
|
||||
? null
|
||||
: (s.requestingExams ? s.openExams : s.openTimetable),
|
||||
tooltip: '读取当前页面',
|
||||
onPressed: _saving ? null : s.readCurrentPage,
|
||||
icon: const Icon(Icons.sync_rounded),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user