Merge pull request #2973 from pangeachat/sentry
chore: some sentry fixes
This commit is contained in:
commit
b4b3e1d55a
6 changed files with 34 additions and 26 deletions
|
|
@ -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…
Add table
Reference in a new issue