From 752d84ffb0fca52bd9bb1f2691c685fab5c7712e Mon Sep 17 00:00:00 2001 From: fufesou Date: Fri, 18 Nov 2022 10:19:55 +0800 Subject: [PATCH] fix remember peer card view type Signed-off-by: fufesou --- flutter/lib/common/widgets/peer_tab_page.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 9129e4711..523230810 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -28,14 +28,16 @@ class _PeerTabPageState extends State setPeer() { final index = bind.getLocalFlutterConfig(k: 'peer-tab-index'); - if (index == '') return; - _tabIndex.value = int.parse(index); + if (index != '') { + _tabIndex.value = int.parse(index); + } final uiType = bind.getLocalFlutterConfig(k: 'peer-card-ui-type'); - if (uiType == '') return; - peerCardUiType.value = int.parse(uiType) == PeerUiType.list.index - ? PeerUiType.list - : PeerUiType.grid; + if (uiType != '') { + peerCardUiType.value = int.parse(uiType) == PeerUiType.list.index + ? PeerUiType.list + : PeerUiType.grid; + } } // hard code for now