Skip to content

Commit

Permalink
fix: use internal parse/stringify function for timeline event
Browse files Browse the repository at this point in the history
  • Loading branch information
webfansplz committed Jun 7, 2024
1 parent a9801ea commit 8d08934
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/applet/src/components/timeline/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DevToolsMessagingEvents, rpc } from '@vue/devtools-core'
import { computed, onUnmounted, ref } from 'vue'
import type { CustomInspectorState, TimelineEventOptions } from '@vue/devtools-kit'
import { parse } from '@vue/devtools-kit'
import EventList from './EventList.vue'
import Navbar from '~/components/basic/Navbar.vue'
import Empty from '~/components/basic/Empty.vue'
Expand Down Expand Up @@ -73,7 +74,8 @@ function normalizeGroupList(event: TimelineEventOptions['event']) {
}
}
function onTimelineEventUpdated(payload) {
function onTimelineEventUpdated(_payload) {
const payload = parse(_payload)
if (!payload)
return
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/rpc/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const functions = {
broadcast.emit(DevToolsMessagingEvents.ROUTER_INFO_UPDATED, state)
})
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_TIMELINE_EVENT_TO_CLIENT, (payload) => {
broadcast.emit(DevToolsMessagingEvents.TIMELINE_EVENT_UPDATED, payload)
broadcast.emit(DevToolsMessagingEvents.TIMELINE_EVENT_UPDATED, stringify(payload))
})
devtools.ctx.hooks.hook(DevToolsMessagingHookKeys.SEND_INSPECTOR_TO_CLIENT, (payload) => {
broadcast.emit(DevToolsMessagingEvents.INSPECTOR_UPDATED, payload)
Expand Down

0 comments on commit 8d08934

Please sign in to comment.