diff --git a/lib/pods/userinfo.dart b/lib/pods/userinfo.dart index 2106332..2296ebd 100644 --- a/lib/pods/userinfo.dart +++ b/lib/pods/userinfo.dart @@ -11,11 +11,6 @@ class UserInfoNotifier extends StateNotifier> { UserInfoNotifier(this._ref) : super(const AsyncValue.data(null)); - Future getAccessToken() async { - final prefs = _ref.read(sharedPreferencesProvider); - return prefs.getString(kTokenPairStoreKey); - } - Future fetchUser() async { try { final client = _ref.read(apiClientProvider); diff --git a/lib/widgets/chat/call_button.dart b/lib/widgets/chat/call_button.dart index a4d6add..a3dcf30 100644 --- a/lib/widgets/chat/call_button.dart +++ b/lib/widgets/chat/call_button.dart @@ -44,7 +44,7 @@ class AudioCallButton extends HookConsumerWidget { try { await apiClient.post('/chat/realtime/$roomId'); if (context.mounted) { - context.push('/chat/call/roomId'); + context.push('/chat/call/$roomId'); } } catch (e) { showErrorAlert(e); @@ -96,7 +96,7 @@ class AudioCallButton extends HookConsumerWidget { tooltip: 'Join Ongoing Call', onPressed: () { if (context.mounted) { - context.push('/chat/call/roomId'); + context.push('/chat/$roomId/call'); } }, ); diff --git a/lib/widgets/share/share_sheet.dart b/lib/widgets/share/share_sheet.dart index b0ff17d..5f47681 100644 --- a/lib/widgets/share/share_sheet.dart +++ b/lib/widgets/share/share_sheet.dart @@ -11,7 +11,6 @@ import 'package:island/models/file.dart'; import 'package:island/pods/link_preview.dart'; import 'package:island/pods/network.dart'; import 'package:island/pods/config.dart'; -import 'package:island/pods/userinfo.dart'; import 'package:island/services/file.dart'; import 'package:mime/mime.dart'; @@ -193,7 +192,6 @@ class _ShareSheetState extends ConsumerState { setState(() => _isLoading = true); try { final apiClient = ref.read(apiClientProvider); - final userInfo = ref.read(userInfoProvider.notifier); final serverUrl = ref.read(serverUrlProvider); String content = _messageController.text.trim(); @@ -218,7 +216,7 @@ class _ShareSheetState extends ConsumerState { case ShareContentType.file: // Upload files to cloud storage if (widget.content.files?.isNotEmpty == true) { - final token = await userInfo.getAccessToken(); + final token = ref.watch(tokenProvider)?.token; if (token == null) { throw Exception('Authentication required'); }