Merge branch 'main' into space-details-tooltips

pull/2245/head
ggurdin 5 months ago committed by GitHub
commit 422ac25b51
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -178,13 +178,17 @@ class _SpaceViewState extends State<SpaceView> {
await _joinDefaultChats();
} catch (e, s) {
Logs().w('Unable to load hierarchy', e, s);
if (!mounted) return;
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(e.toLocalizedString(context))));
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(e.toLocalizedString(context))),
);
}
} finally {
setState(() {
_isLoading = false;
});
if (mounted) {
setState(() {
_isLoading = false;
});
}
}
}

@ -114,13 +114,15 @@ class ActivitySuggestionsAreaState extends State<ActivitySuggestionsArea> {
final resp = await ActivitySearchRepo.get(request).timeout(
const Duration(seconds: 5),
onTimeout: () {
setState(() {
_timeout = true;
_loading = false;
});
if (mounted) {
setState(() {
_timeout = true;
_loading = false;
});
}
Future.delayed(const Duration(seconds: 5), () {
_setActivityItems(retries: retries + 1);
if (mounted) _setActivityItems(retries: retries + 1);
});
return ActivityPlanResponse(activityPlans: []);
},

@ -132,7 +132,11 @@ extension AnalyticsClientExtension on Client {
/// so other members of the space need to add their analytics rooms to the space.
Future<void> addAnalyticsRoomsToSpaces() async {
if (userID == null || userID == BotName.byEnvironment) return;
final spaces = rooms.where((room) => room.isSpace).toList();
final spaces = rooms
.where(
(room) => room.isSpace && room.membership == Membership.join,
)
.toList();
final Random random = Random();
for (final space in spaces) {

@ -304,7 +304,7 @@ class RoomDetailsButtonRowState extends State<RoomDetailsButtonRow> {
super.dispose();
}
final double _buttonWidth = 165.0;
final double _buttonWidth = 125.0;
final double _buttonHeight = 84.0;
final double _miniButtonWidth = 50.0;
@ -500,11 +500,6 @@ class RoomDetailsButtonRowState extends State<RoomDetailsButtonRow> {
final mini = fullButtonCapacity < 4;
final capacity = mini ? miniButtonCapacity : fullButtonCapacity;
debugPrint(
"RoomDetailsButtonRow: $fullButtonCapacity buttons available",
);
debugPrint("Available width: $availableWidth");
List<ButtonDetails> mainViewButtons =
buttons.where((button) => button.showInMainView).toList();
final List<ButtonDetails> otherButtons =

@ -121,12 +121,7 @@ class Environment {
try {
final String jsonString = await rootBundle.loadString('envs.json');
data = jsonDecode(jsonString);
} catch (e, s) {
ErrorHandler.logError(
e: e,
s: s,
data: {},
);
} catch (e) {
return [];
}

@ -91,8 +91,16 @@ class WordAudioButtonState extends State<WordAudioButton> {
context: context,
targetID: 'word-audio-button-${widget.uniqueID}',
langCode: widget.langCode,
onStart: () => setState(() => _isPlaying = true),
onStop: () => setState(() => _isPlaying = false),
onStart: () {
if (mounted) {
setState(() => _isPlaying = true);
}
},
onStop: () {
if (mounted) {
setState(() => _isPlaying = false);
}
},
);
}
},

Loading…
Cancel
Save