Skip to content

Commit

Permalink
fix: event bus name
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Oct 30, 2023
1 parent e87f784 commit 8c4a9ec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/web-console/src/consts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
******************************************************************************/

export enum BusEvent {
MSG_active_sidebar = "active.panel",
MSG_ACTIVE_SIDEBAR = "active.panel",
MSG_EDITOR_FOCUS = "editor.focus",
MSG_EDITOR_SET = "editor.set",
MSG_EDITOR_INSERT_COLUMN = "editor.insert.column",
Expand Down
2 changes: 1 addition & 1 deletion packages/web-console/src/js/console/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ export const MSG_QUERY_OK = "query.out.ok"
export const MSG_QUERY_ERROR = "query.out.error"
export const MSG_QUERY_DATASET = "query.out.dataset"
export const MSG_QUERY_FIND_N_EXEC = "query.build.execute"
export const MSG_active_sidebar = "active.panel"
export const MSG_ACTIVE_SIDEBAR = "active.panel"
export const MSG_EDITOR_FOCUS = "editor.focus"
export const MSG_CHART_DRAW = "chart.draw"
2 changes: 1 addition & 1 deletion packages/web-console/src/js/console/quick-vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ export function quickVis(root, msgBus) {
function bind() {
viewport = div.find(".quick-vis-canvas")[0]
$(window).resize(resize)
bus.on(qdb.MSG_active_sidebar, resize)
bus.on(qdb.MSG_ACTIVE_SIDEBAR, resize)
echart = echarts.init(viewport, eChartsMacarons)
bus.on(qdb.MSG_QUERY_DATASET, updatePickers)
bus.on(qdb.MSG_QUERY_CANCEL, cancelDraw)
Expand Down
5 changes: 2 additions & 3 deletions packages/web-console/src/scenes/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { ResultViewMode } from "./types"
import { BUTTON_ICON_SIZE } from "../../consts/index"
import { PrimaryToggleButton } from "../../components"
import { Import } from "./import"
import { use } from "echarts"

const Root = styled.div`
display: flex;
Expand Down Expand Up @@ -90,14 +89,14 @@ const Console = () => {
const handleEditorSplitterChange = useCallback((value) => {
updateSettings(StoreKey.EDITOR_SPLITTER_BASIS, value)
setTimeout(() => {
window.bus.trigger(BusEvent.MSG_active_sidebar)
window.bus.trigger(BusEvent.MSG_ACTIVE_SIDEBAR)
}, 0)
}, [])

const handleResultsSplitterChange = useCallback((value) => {
updateSettings(StoreKey.RESULTS_SPLITTER_BASIS, value)
setTimeout(() => {
window.bus.trigger(BusEvent.MSG_active_sidebar)
window.bus.trigger(BusEvent.MSG_ACTIVE_SIDEBAR)
}, 0)
}, [])

Expand Down

0 comments on commit 8c4a9ec

Please sign in to comment.