fix: analytics logging behavior being incorrect (#3064)

This commit is contained in:
Andrew Bastin
2023-05-23 16:34:28 -04:00
committed by GitHub
parent 1b413e2f47
commit aeb9172144
2 changed files with 10 additions and 1 deletions

View File

@@ -258,6 +258,8 @@ import IconSave from "~icons/lucide/save"
import IconShare2 from "~icons/lucide/share-2"
import { HoppRESTTab } from "~/helpers/rest/tab"
import { getDefaultRESTRequest } from "~/helpers/rest/default"
import { platform } from "~/platform"
import { getCurrentStrategyID } from "~/helpers/network"
const t = useI18n()
@@ -320,6 +322,12 @@ const newSendRequest = async () => {
loading.value = true
// Log the request run into analytics
platform.analytics?.logHoppRequestRunToAnalytics({
platform: "rest",
strategy: getCurrentStrategyID(),
})
// Double calling is because the function returns a TaskEither than should be executed
const streamResult = await runRESTRequest$(tab)()

View File

@@ -187,6 +187,8 @@ export function useCodemirror(
: null
const initView = (el: any) => {
if (el) platform.ui?.onCodemirrorInstanceMount?.(el)
const extensions = [
basicSetup,
baseTheme,
@@ -268,7 +270,6 @@ export function useCodemirror(
onMounted(() => {
if (el.value) {
if (!view.value) initView(el.value)
platform.ui?.onCodemirrorInstanceMount?.(el.value)
}
})