Merge pull request #188 from cogwheel0/improve-user-data-handling
improve-user-data-handling
This commit is contained in:
@@ -338,9 +338,6 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
||||
// Strip leading '/' prefix so we can match prompt commands (e.g., "help")
|
||||
final String searchQuery = query.startsWith('/') ? query.substring(1) : query;
|
||||
|
||||
// Prevent matching all prompts when user types only '/'
|
||||
if (searchQuery.isEmpty) return const <Prompt>[];
|
||||
|
||||
final List<Prompt> filtered =
|
||||
prompts
|
||||
.where(
|
||||
@@ -976,6 +973,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
||||
final List<Widget> composerChildren = <Widget>[
|
||||
if (_showPromptOverlay)
|
||||
Padding(
|
||||
key: const ValueKey('prompt-overlay'),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
Spacing.sm,
|
||||
0,
|
||||
@@ -986,6 +984,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
||||
),
|
||||
if (showCompactComposer)
|
||||
Padding(
|
||||
key: const ValueKey('composer-compact'),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
Spacing.screenPadding,
|
||||
Spacing.xs,
|
||||
@@ -1059,6 +1058,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
||||
)
|
||||
else ...[
|
||||
Padding(
|
||||
key: const ValueKey('composer-expanded-input'),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
Spacing.sm,
|
||||
Spacing.xs,
|
||||
@@ -1097,6 +1097,7 @@ class _ModernChatInputState extends ConsumerState<ModernChatInput>
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
key: const ValueKey('composer-expanded-buttons'),
|
||||
padding: const EdgeInsets.fromLTRB(
|
||||
Spacing.inputPadding,
|
||||
0,
|
||||
|
||||
@@ -1478,7 +1478,12 @@ class _ChatsDrawerState extends ConsumerState<ChatsDrawer> {
|
||||
Widget _buildBottomSection(BuildContext context) {
|
||||
final theme = context.conduitTheme;
|
||||
final sidebarTheme = context.sidebarTheme;
|
||||
final user = ref.watch(currentUserProvider2);
|
||||
final authUser = ref.watch(currentUserProvider2);
|
||||
final asyncUser = ref.watch(currentUserProvider);
|
||||
final user = asyncUser.maybeWhen(
|
||||
data: (value) => value ?? authUser,
|
||||
orElse: () => authUser,
|
||||
);
|
||||
final api = ref.watch(apiServiceProvider);
|
||||
|
||||
String initialFor(String name) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter_animate/flutter_animate.dart';
|
||||
import 'package:conduit/l10n/app_localizations.dart';
|
||||
|
||||
import '../../auth/providers/unified_auth_providers.dart';
|
||||
import '../../../core/providers/app_providers.dart';
|
||||
import '../../../core/utils/user_display_name.dart';
|
||||
import '../../../shared/theme/theme_extensions.dart';
|
||||
import '../../../shared/widgets/sheet_handle.dart';
|
||||
@@ -67,7 +68,12 @@ class _OnboardingSheetState extends ConsumerState<OnboardingSheet> {
|
||||
Widget build(BuildContext context) {
|
||||
final height = MediaQuery.of(context).size.height;
|
||||
final l10n = AppLocalizations.of(context)!;
|
||||
final user = ref.watch(currentUserProvider2);
|
||||
final authUser = ref.watch(currentUserProvider2);
|
||||
final asyncUser = ref.watch(currentUserProvider);
|
||||
final user = asyncUser.maybeWhen(
|
||||
data: (value) => value ?? authUser,
|
||||
orElse: () => authUser,
|
||||
);
|
||||
final greetingName = deriveUserDisplayName(user);
|
||||
final pages = _buildPages(l10n, greetingName);
|
||||
final pageCount = pages.length;
|
||||
|
||||
@@ -41,7 +41,12 @@ class ProfilePage extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final user = ref.watch(currentUserProvider2);
|
||||
final authUser = ref.watch(currentUserProvider2);
|
||||
final asyncUser = ref.watch(currentUserProvider);
|
||||
final user = asyncUser.maybeWhen(
|
||||
data: (value) => value ?? authUser,
|
||||
orElse: () => authUser,
|
||||
);
|
||||
final isAuthLoading = ref.watch(isAuthLoadingProvider2);
|
||||
final api = ref.watch(apiServiceProvider);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user