Skip to content

Commit bddcd45

Browse files
committed
fix: better handle tab disconnection
1 parent c2cbd0d commit bddcd45

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/app-frontend/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { createApp, connectApp } from './app'
66
import { setAppConnected } from './features/connection'
77
import { getBridge } from './features/bridge'
88

9+
export { setAppConnected } from './features/connection'
10+
911
/**
1012
* Create the main devtools app. Expects to be called with a shell interface
1113
* which implements a connect method.

packages/shell-chrome/src/devtools.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// this script is called when the VueDevtools panel is activated.
22

3-
import { initDevTools } from '@front'
3+
import { initDevTools, setAppConnected } from '@front'
44
import { Bridge } from '@vue-devtools/shared-utils'
55

66
initDevTools({
@@ -21,6 +21,7 @@ initDevTools({
2121
let disconnected = false
2222
port.onDisconnect.addListener(() => {
2323
disconnected = true
24+
setAppConnected(false)
2425
})
2526

2627
const bridge = new Bridge({

0 commit comments

Comments
 (0)