chore: Update SDK

This commit is contained in:
Christian Pauly 2022-07-09 10:18:53 +02:00
parent 3c7926c81a
commit 4e73e6d9f4
8 changed files with 29 additions and 32 deletions

View File

@ -528,8 +528,8 @@ class ChatListController extends State<ChatList> with TickerProviderStateMixin {
final client = Matrix.of(context).client;
await client.roomsLoading;
await client.accountDataLoading;
if (client.prevBatch?.isEmpty ?? true) {
await client.onFirstSync.stream.first;
if (client.onSync.value == null) {
await client.onSync.stream.first;
}
// Load space members to display DM rooms
final spaceId = activeSpaceId;

View File

@ -219,7 +219,7 @@ class BackgroundPush {
Future<void> setupPush() async {
Logs().d("SetupPush");
if (client.loginState != LoginState.loggedIn ||
if (client.onLoginStateChanged.value != LoginState.loggedIn ||
!PlatformInfos.isMobile ||
context == null) {
return;

View File

@ -164,4 +164,10 @@ class VoipPlugin extends WidgetsBindingObserver implements WebRTCDelegate {
void handleNewGroupCall(GroupCall groupCall) {
// TODO: implement handleNewGroupCall
}
@override
Future<webrtc_impl.MediaStream> cloneStream(webrtc_impl.MediaStream stream) {
// TODO: implement cloneStream
throw UnimplementedError();
}
}

View File

@ -16,33 +16,28 @@ class ConnectionStatusHeader extends StatefulWidget {
}
class _ConnectionStatusHeaderState extends State<ConnectionStatusHeader> {
StreamSubscription? _onSyncSub;
static bool _anySyncReceived = false;
late final StreamSubscription _onSyncSub;
SyncStatusUpdate _status =
const SyncStatusUpdate(SyncStatus.waitingForResponse);
@override
void initState() {
_onSyncSub = Matrix.of(context).client.onSyncStatus.stream.listen(
(_) => setState(() {}),
);
super.initState();
}
@override
void dispose() {
_onSyncSub?.cancel();
_onSyncSub.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
_onSyncSub ??= Matrix.of(context).client.onSyncStatus.stream.listen(
(status) => setState(
() {
_status = status;
if (status.status == SyncStatus.finished) {
_anySyncReceived = true;
}
},
),
);
final hide = _anySyncReceived &&
_status.status != SyncStatus.error &&
final status = Matrix.of(context).client.onSyncStatus.value ??
const SyncStatusUpdate(SyncStatus.waitingForResponse);
final hide = Matrix.of(context).client.onSync.value != null &&
status.status != SyncStatus.error &&
Matrix.of(context).client.prevBatch != null;
return AnimatedContainer(
@ -60,12 +55,12 @@ class _ConnectionStatusHeaderState extends State<ConnectionStatusHeader> {
height: 24,
child: CircularProgressIndicator.adaptive(
strokeWidth: 2,
value: hide ? 1.0 : _status.progress,
value: hide ? 1.0 : status.progress,
),
),
const SizedBox(width: 12),
Text(
_status.toLocalizedString(context),
status.toLocalizedString(context),
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(color: Theme.of(context).colorScheme.onSurface),

View File

@ -13,10 +13,8 @@ class LoadingView extends StatelessWidget {
Widget build(BuildContext context) {
WidgetsBinding.instance.addPostFrameCallback(
(_) => VRouter.of(context).to(
Matrix.of(context)
.widget
.clients
.any((client) => client.loginState == LoginState.loggedIn)
Matrix.of(context).widget.clients.any((client) =>
client.onLoginStateChanged.value == LoginState.loggedIn)
? '/rooms'
: '/home',
queryParameters: VRouter.of(context).queryParameters,

View File

@ -211,7 +211,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
}
}
} catch (e, s) {
client.onLoginStateChanged.sink.addError(e, s);
client.onLoginStateChanged.addError(e, s);
SentryController.captureException(e, s);
rethrow;
}

View File

@ -1019,7 +1019,7 @@ packages:
name: matrix
url: "https://pub.dartlang.org"
source: hosted
version: "0.10.1"
version: "0.10.3"
matrix_api_lite:
dependency: transitive
description:

View File

@ -57,7 +57,7 @@ dependencies:
keyboard_shortcuts: ^0.1.4
localstorage: ^4.0.0+1
lottie: ^1.2.2
matrix: ^0.10.1
matrix: ^0.10.3
matrix_homeserver_recommendations: ^0.2.0
matrix_link_text: ^1.0.2
native_imaging:
@ -158,5 +158,3 @@ dependency_overrides:
git:
url: https://github.com/TheOneWithTheBraid/snapping_sheet.git
ref: listenable
#matrix:
# path: ../famedlysdk/