improve open url dialog opening time
This commit is contained in:
@@ -26,7 +26,6 @@ import 'package:weblibre/core/logger.dart';
|
||||
import 'package:weblibre/core/routing/routes.dart';
|
||||
import 'package:weblibre/data/models/received_intent_parameter.dart';
|
||||
import 'package:weblibre/features/app_widget/domain/services/home_widget.dart';
|
||||
import 'package:weblibre/features/geckoview/domain/providers.dart';
|
||||
import 'package:weblibre/features/share_intent/domain/entities/shared_content.dart';
|
||||
import 'package:weblibre/features/share_intent/domain/services/sharing_intent.dart';
|
||||
|
||||
@@ -36,10 +35,8 @@ final _contentParserTransformer =
|
||||
StreamTransformer<ReceivedIntentParameter, SharedContent>.fromHandlers(
|
||||
handleData: (parameter, sink) {
|
||||
final parsed = parameter.content.mapNotNull(
|
||||
(content) => SharedContent.parse(
|
||||
content,
|
||||
contextId: parameter.contextId,
|
||||
),
|
||||
(content) =>
|
||||
SharedContent.parse(content, contextId: parameter.contextId),
|
||||
);
|
||||
|
||||
if (parsed != null) {
|
||||
@@ -54,11 +51,6 @@ final _contentParserTransformer =
|
||||
class EngineBoundIntentStream extends _$EngineBoundIntentStream {
|
||||
@override
|
||||
Stream<SharedContent> build() {
|
||||
final engineReady = ref.watch(engineReadyStateProvider);
|
||||
if (!engineReady) {
|
||||
return const Stream.empty();
|
||||
}
|
||||
|
||||
final sharingItentStream = ref.watch(sharingIntentStreamProvider);
|
||||
final appWidgetLaunchStream = ref.watch(appWidgetLaunchStreamProvider);
|
||||
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ final class EngineBoundIntentStreamProvider
|
||||
}
|
||||
|
||||
String _$engineBoundIntentStreamHash() =>
|
||||
r'618eb6431da93989de6f1780cba2993458b0014e';
|
||||
r'8170f28c2ce69813066780a65205426182a26863';
|
||||
|
||||
abstract class _$EngineBoundIntentStream
|
||||
extends $StreamNotifier<SharedContent> {
|
||||
|
||||
+14
-12
@@ -221,6 +221,8 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
await widget.postInitializationStep?.call();
|
||||
|
||||
if (!_initializationCompleter.isCompleted) {
|
||||
_initializationCompleter.complete();
|
||||
|
||||
const quickActions = QuickActions();
|
||||
|
||||
//Debounce: https://github.com/flutter/flutter/issues/131121
|
||||
@@ -284,8 +286,6 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
localizedTitle: 'New Isolated Tab',
|
||||
),
|
||||
]);
|
||||
|
||||
_initializationCompleter.complete();
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -349,24 +349,24 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
|
||||
ref.listenManual(
|
||||
engineBoundIntentStreamProvider,
|
||||
(previous, next) async {
|
||||
await _initializationCompleter.future;
|
||||
|
||||
(previous, next) {
|
||||
next.whenData((sharedContent) async {
|
||||
final router = await ref.read(routerProvider.future);
|
||||
final settings = ref.read(generalSettingsWithDefaultsProvider);
|
||||
|
||||
// Resolve container from shortcut intent context ID
|
||||
final containerSelection = await _resolveContainerSelection(
|
||||
ref,
|
||||
sharedContent.contextId,
|
||||
);
|
||||
|
||||
switch (settings.tabIntentOpenSetting) {
|
||||
case TabIntentOpenSetting.regular:
|
||||
case TabIntentOpenSetting.private:
|
||||
await ref
|
||||
.read(engineReadyStateProvider.notifier)
|
||||
.waitUntilReady();
|
||||
|
||||
switch (sharedContent) {
|
||||
case SharedUrl():
|
||||
final containerSelection = await _resolveContainerSelection(
|
||||
ref,
|
||||
sharedContent.contextId,
|
||||
);
|
||||
|
||||
await ref
|
||||
.read(tabRepositoryProvider.notifier)
|
||||
.addTab(
|
||||
@@ -399,6 +399,8 @@ class _BrowserViewState extends ConsumerState<BrowserView>
|
||||
);
|
||||
}
|
||||
case TabIntentOpenSetting.ask:
|
||||
final router = await ref.read(routerProvider.future);
|
||||
|
||||
switch (sharedContent) {
|
||||
case SharedUrl():
|
||||
final route = OpenSharedContentRoute(
|
||||
|
||||
Reference in New Issue
Block a user