fix: automate graduate timetable read and refine blue glass Dock
This commit is contained in:
@@ -4,14 +4,17 @@ import 'school_navigation_policy.dart';
|
||||
class SchoolLoginFlow {
|
||||
Uri? _target;
|
||||
bool _requested = false;
|
||||
int _attempts = 0;
|
||||
void begin(Uri target) {
|
||||
_target = target;
|
||||
_requested = false;
|
||||
_attempts = 0;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
_target = null;
|
||||
_requested = false;
|
||||
_attempts = 0;
|
||||
}
|
||||
|
||||
Uri? onLoaded(Uri uri, {required bool authenticated}) {
|
||||
@@ -24,11 +27,13 @@ class SchoolLoginFlow {
|
||||
}
|
||||
if (uri.path == _target!.path ||
|
||||
_requested ||
|
||||
_attempts >= 2 ||
|
||||
!authenticated ||
|
||||
!uri.path.startsWith('/pyxx/')) {
|
||||
!SchoolNavigationPolicy.isGraduatePage(uri)) {
|
||||
return null;
|
||||
}
|
||||
_requested = true;
|
||||
_attempts++;
|
||||
return _target;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user