share tracking
This commit is contained in:
@@ -210,6 +210,7 @@ const shareUrl = ref(null)
|
||||
|
||||
function shareOrder() {
|
||||
sharing.value = true
|
||||
track('share')
|
||||
getShareUrl().then(url => {
|
||||
shareUrl.value = url
|
||||
sharing.value = false
|
||||
|
||||
@@ -3,6 +3,7 @@ import {useChartOrderStore} from "@/orderbuild.js";
|
||||
import {changeIntervalSecs, onChartReady, setSymbol, widget} from "@/charts/chart.js";
|
||||
import {usePrefStore, useStore} from "@/store/store.js";
|
||||
import {lookupSymbol} from "@/charts/datafeed.js";
|
||||
import {track} from "@/track.js";
|
||||
|
||||
export async function getShareUrl() {
|
||||
const co = useChartOrderStore();
|
||||
@@ -26,7 +27,9 @@ export async function getShareUrl() {
|
||||
const json = JSON.stringify(data)
|
||||
console.log('sharing data', json, data)
|
||||
const compressed = compressToEncodedURIComponent(json);
|
||||
const baseUrl = `${window.location.protocol}//${window.location.hostname}:${window.location.port}`;
|
||||
let baseUrl = `${window.location.protocol}//${window.location.hostname}`;
|
||||
if (window.location.port)
|
||||
baseUrl += ':' + window.location.port
|
||||
const imageFile = await takeSnapshot()
|
||||
return `${baseUrl}/shared?i=${imageFile}&d=${compressed}`;
|
||||
}
|
||||
@@ -59,6 +62,7 @@ export function loadShareUrl() {
|
||||
setSymbol(symbol)
|
||||
.catch((e)=>console.error('could not set symbol', e))
|
||||
})
|
||||
track('shared')
|
||||
console.log('loaded orders', s.chainId, co.orders)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user