Add mounted check

This commit is contained in:
ashilkn
2025-06-30 15:36:38 +05:30
parent 354c08921b
commit 489c806923

View File

@@ -224,11 +224,13 @@ class _MemoryCoverWidgetState extends State<MemoryCoverWidget> {
void _preloadFirstUnseenMemory() {
Future.delayed(const Duration(seconds: 5), () {
if (widget.memories.isEmpty) return;
if (mounted) {
if (widget.memories.isEmpty) return;
final index = _getNextMemoryIndex();
preloadThumbnail(widget.memories[index].file);
preloadFile(widget.memories[index].file);
final index = _getNextMemoryIndex();
preloadThumbnail(widget.memories[index].file);
preloadFile(widget.memories[index].file);
}
});
}