fix: close previous tab causes reconnection

This commit is contained in:
Kingtous 2022-11-01 10:10:40 +08:00
parent 17123ce9ee
commit 43f9191a6b

View File

@ -80,14 +80,17 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
selectedIcon: selectedIcon, selectedIcon: selectedIcon,
unselectedIcon: unselectedIcon, unselectedIcon: unselectedIcon,
onTabCloseButton: () => tabController.closeBy(id), onTabCloseButton: () => tabController.closeBy(id),
page: Obx(() => RemotePage( page: ObxValue<RxBool>(
key: ValueKey(id), (fullscreen) => RemotePage(
id: id, id: id,
windowId: windowId(), windowId: windowId(),
tabBarHeight: tabBarHeight:
fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight, fullscreen.isTrue ? 0 : kDesktopRemoteTabBarHeight,
windowBorderWidth: fullscreen.isTrue ? 0 : kWindowBorderWidth, windowBorderWidth: fullscreen.isTrue ? 0 : kWindowBorderWidth,
)))); ),
fullscreen,
key: ValueKey(id),
)));
} else if (call.method == "onDestroy") { } else if (call.method == "onDestroy") {
tabController.clear(); tabController.clear();
} else if (call.method == kWindowActionRebuild) { } else if (call.method == kWindowActionRebuild) {