Skip to content

Commit

Permalink
fix: revert getting pinia state on update (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azurewarth0920 authored Mar 5, 2024
1 parent 26b74b7 commit a79e23f
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions packages/client/src/pages/pinia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ const getInspectorState = defineDevToolsAction('devtools:inspector-state', (devt
return devtools.api.getInspectorState(payload)
})
const onComponentUpdated = defineDevToolsListener((devtools, callback) => {
devtools.api.on.componentUpdated(() => {
callback()
})
})
const onInspectorTreeUpdated = defineDevToolsListener<string>((devtools, callback) => {
devtools.api.on.sendInspectorTree((payload) => {
callback(payload)
Expand Down Expand Up @@ -59,19 +53,13 @@ watch(selected, () => {
createCollapseContext('inspector-state')
onDevToolsClientConnected(() => {
const getPiniaInspectorTree = () => {
getInspectorTree({ inspectorId, filter: '' }).then((_data) => {
const data = parse(_data)
tree.value = data
if (!selected.value && data.length)
selected.value = data[0].id
getInspectorTree({ inspectorId, filter: '' }).then((_data) => {
const data = parse(_data)
tree.value = data
if (!selected.value && data.length) {
selected.value = data[0].id
getPiniaState(data[0].id)
})
}
getPiniaInspectorTree()
onComponentUpdated(() => {
getPiniaInspectorTree()
}
})
onInspectorTreeUpdated((_data) => {
Expand Down

0 comments on commit a79e23f

Please sign in to comment.