share landing page bugfixes
This commit is contained in:
@@ -27,11 +27,8 @@ export async function getShareUrl() {
|
||||
const json = JSON.stringify(data)
|
||||
console.log('sharing data', json, data)
|
||||
const compressed = compressToEncodedURIComponent(json);
|
||||
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}`;
|
||||
return import.meta.env.VITE_SERVER_URL+ `/share?i=${imageFile}&d=${compressed}`;
|
||||
}
|
||||
|
||||
export function loadShareUrl() {
|
||||
@@ -69,7 +66,7 @@ export function loadShareUrl() {
|
||||
export async function takeSnapshot() {
|
||||
const screenshotCanvas = await widget.takeClientScreenshot();
|
||||
const image = await new Promise((resolve) => screenshotCanvas.toBlob(resolve));
|
||||
const response = await fetch(import.meta.env.VITE_SNAPSHOT_URL, {
|
||||
const response = await fetch(import.meta.env.VITE_SERVER_URL + '/snapshot', {
|
||||
method: 'PUT',
|
||||
body: image,
|
||||
credentials: 'same-origin',
|
||||
|
||||
Reference in New Issue
Block a user