From a79e23f2bd9e910a3973bbb97b3471a82db14d79 Mon Sep 17 00:00:00 2001 From: Fan Pei Date: Tue, 5 Mar 2024 19:19:48 +0900 Subject: [PATCH] fix: revert getting pinia state on update (#264) --- packages/client/src/pages/pinia.vue | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/client/src/pages/pinia.vue b/packages/client/src/pages/pinia.vue index 2c3346d9..07edcd5a 100644 --- a/packages/client/src/pages/pinia.vue +++ b/packages/client/src/pages/pinia.vue @@ -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((devtools, callback) => { devtools.api.on.sendInspectorTree((payload) => { callback(payload) @@ -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) => {