mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2025-02-22 17:20:43 +01:00
have Matrix.getBundles() use client instead of clientIndex
This commit is contained in:
parent
7c40f72f55
commit
a973f8d371
@ -77,8 +77,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
return activeClient;
|
||||
}
|
||||
|
||||
Map<String, List<int>> getBundles() {
|
||||
final resBundles = <String, List<_AccountBundleWithClientIndex>>{};
|
||||
Map<String, List<Client>> getBundles() {
|
||||
final resBundles = <String, List<_AccountBundleWithClient>>{};
|
||||
for (var i = 0; i < widget.clients.length; i++) {
|
||||
final bundles = widget.clients[i].accountBundles;
|
||||
for (final bundle in bundles) {
|
||||
@ -86,8 +86,8 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
continue;
|
||||
}
|
||||
resBundles[bundle.name] ??= [];
|
||||
resBundles[bundle.name].add(_AccountBundleWithClientIndex(
|
||||
index: i,
|
||||
resBundles[bundle.name].add(_AccountBundleWithClient(
|
||||
client: widget.clients[i],
|
||||
bundle: bundle,
|
||||
));
|
||||
}
|
||||
@ -100,7 +100,7 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||
: a.bundle.priority.compareTo(b.bundle.priority));
|
||||
}
|
||||
return resBundles
|
||||
.map((k, v) => MapEntry(k, v.map((vv) => vv.index).toList()));
|
||||
.map((k, v) => MapEntry(k, v.map((vv) => vv.client).toList()));
|
||||
}
|
||||
|
||||
bool get hasComplexBundles => getBundles().values.any((v) => v.length > 1);
|
||||
@ -597,8 +597,8 @@ class FixedThreepidCreds extends ThreepidCreds {
|
||||
}
|
||||
}
|
||||
|
||||
class _AccountBundleWithClientIndex {
|
||||
final int index;
|
||||
class _AccountBundleWithClient {
|
||||
final Client client;
|
||||
final AccountBundle bundle;
|
||||
_AccountBundleWithClientIndex({this.index, this.bundle});
|
||||
_AccountBundleWithClient({this.client, this.bundle});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user