chore: remove unwanted debug info (#2851)

This commit is contained in:
Akash K
2022-11-10 04:07:05 +05:30
committed by GitHub
parent 356fe4591f
commit 1ecd22204d

View File

@@ -40,8 +40,6 @@ import {
import { HoppEnvironmentPlugin } from "@helpers/editor/extensions/HoppEnvironment" import { HoppEnvironmentPlugin } from "@helpers/editor/extensions/HoppEnvironment"
// TODO: Migrate from legacy mode // TODO: Migrate from legacy mode
import { captureException } from "@sentry/vue"
type ExtendedEditorConfig = { type ExtendedEditorConfig = {
mode: string mode: string
placeholder: string placeholder: string
@@ -286,7 +284,7 @@ export function useCodemirror(
view.value?.destroy() view.value?.destroy()
}) })
watch(value, (newVal, oldVal) => { watch(value, (newVal) => {
if (newVal === undefined) { if (newVal === undefined) {
view.value?.destroy() view.value?.destroy()
view.value = undefined view.value = undefined
@@ -297,29 +295,14 @@ export function useCodemirror(
initView(el.value) initView(el.value)
} }
if (cachedValue.value !== newVal) { if (cachedValue.value !== newVal) {
try { view.value?.dispatch({
view.value?.dispatch({ filter: false,
filter: false, changes: {
changes: { from: 0,
from: 0, to: view.value.state.doc.length,
to: view.value.state.doc.length, insert: newVal,
insert: newVal, },
}, })
})
} catch (e) {
captureException(e, {
extra: {
newVal,
oldVal,
changes: {
from: 0,
to: view.value?.state.doc.length,
insert: newVal,
cachedValue,
},
},
})
}
} }
cachedValue.value = newVal cachedValue.value = newVal
}) })