Skip to content

Commit

Permalink
Merge branch 'master' into search-sdk-top
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos authored Aug 15, 2024
2 parents f8bf56c + a71abd3 commit 2c6bd70
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/lib/package/overrides.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final _reservedPackageNames = <String>[
'hook',
'kotlin', // for yousefi@
'ok_http', // https://github.com/dart-lang/http/tree/master/pkgs/ok_http
'credilio_sbm', // for owner of package:crediliosbm
].map(reducePackageName).toList();

const redirectPackageUrls = <String, String>{
Expand All @@ -50,6 +51,8 @@ const redirectPackageUrls = <String, String>{
'https://api.flutter.dev/flutter/flutter_driver/flutter_driver-library.html',
'flutter_driver_extension':
'https://api.flutter.dev/flutter/flutter_driver_extension/flutter_driver_extension-library.html',
'flutter_gpu':
'https://main-api.flutter.dev/flutter/flutter_gpu/flutter_gpu-library.html',
'flutter_localizations':
'https://api.flutter.dev/flutter/flutter_localizations/flutter_localizations-library.html',
'flutter_test':
Expand Down
5 changes: 5 additions & 0 deletions pkg/web_app/lib/src/page_updater.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ Document _update(
required bool pushState,
required String? url,
}) {
// The dark theme preference is encoded in the `<body>` element's `class`
// attributes. We could re-run the initialization, but storing the current
// values and replacing the provided ones is simpler.
final oldClasses = document.body!.className;
final doc = DomParser().parseFromString(html, 'text/html');
document.querySelector('body')!.replaceWith(doc.querySelector('body')!);
document.body!.className = oldClasses;
_popStateFn!();
if (pushState) {
final title = doc.querySelector('title')?.text;
Expand Down

0 comments on commit 2c6bd70

Please sign in to comment.