chore: update svg when svg url changes (#2341)
This commit is contained in:
parent
3a06fddcc4
commit
0c988d55f7
2 changed files with 13 additions and 1 deletions
|
|
@ -43,7 +43,6 @@ import '../../widgets/matrix.dart';
|
|||
import 'package:fluffychat/utils/tor_stub.dart'
|
||||
if (dart.library.html) 'package:tor_detector_web/tor_detector_web.dart';
|
||||
|
||||
|
||||
enum PopupMenuAction {
|
||||
settings,
|
||||
invite,
|
||||
|
|
|
|||
|
|
@ -64,6 +64,19 @@ class _CustomizedSvgState extends State<CustomizedSvg> {
|
|||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant CustomizedSvg oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (oldWidget.svgUrl != widget.svgUrl) {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
_hasError = false;
|
||||
_showProgressIndicator = false;
|
||||
});
|
||||
_loadSvg();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _loadSvg() async {
|
||||
try {
|
||||
final cached = _getSvgFromCache();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue