From cedf4037fff0def994733f6bd86e2f6125892841 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sat, 23 Jul 2022 22:55:50 -0500 Subject: [PATCH] update share param --- package.json | 2 +- src/components/ep-explorer/EPExplorer.tsx | 8 ++++---- src/components/vp-explorer/VPExplorer.tsx | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 6735da1..d17cd22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "3.5.1", + "version": "3.5.2", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/ep-explorer/EPExplorer.tsx b/src/components/ep-explorer/EPExplorer.tsx index ffbaca7..c2644b1 100644 --- a/src/components/ep-explorer/EPExplorer.tsx +++ b/src/components/ep-explorer/EPExplorer.tsx @@ -12,7 +12,7 @@ import autoAnimate from "@formkit/auto-animate"; // @ts-ignore import LZString from "lz-string"; import EPPicker from "./EPPicker"; -const phraseURLParam = "EPhrase"; +const epPhraseURLParam = "ep"; const blankEps: T.EPSelectionState = { blocks: makeEPSBlocks(), @@ -162,8 +162,8 @@ function getShareUrl(eps: T.EPSelectionState): string { const url = new URL(window.location.href); // need to delete or else you could just get a second param written after // which gets ignored - url.searchParams.delete(phraseURLParam); - url.searchParams.append(phraseURLParam, encoded); + url.searchParams.delete(epPhraseURLParam); + url.searchParams.append(epPhraseURLParam, encoded); return url.toString(); } @@ -173,7 +173,7 @@ function getCode(eps: T.EPSelectionState): string { function getEPSFromUrl(): T.EPSelectionState | undefined { const params = new URLSearchParams(window.location.search); - const fromParams = params.get(phraseURLParam); + const fromParams = params.get(epPhraseURLParam); if (!fromParams) return; const decoded = LZString.decompressFromEncodedURIComponent(fromParams); return JSON.parse(decoded) as T.EPSelectionState; diff --git a/src/components/vp-explorer/VPExplorer.tsx b/src/components/vp-explorer/VPExplorer.tsx index 8cfb5a0..7a3030f 100644 --- a/src/components/vp-explorer/VPExplorer.tsx +++ b/src/components/vp-explorer/VPExplorer.tsx @@ -15,7 +15,7 @@ import { vpsReducer } from "./vps-reducer"; import { getObjectSelection } from "../../lib/phrase-building/blocks-utils"; import VPPicker from "./VPPicker"; -const phraseURLParam = "VPhrase"; +export const vpPhraseURLParam = "vp"; // TODO: Issue with dynamic compounds english making with plurals // TODO: Issue with "the money were taken" @@ -205,8 +205,8 @@ function getShareUrl(vps: T.VPSelectionState): string { const url = new URL(window.location.href); // need to delete or else you could just get a second param written after // which gets ignored - url.searchParams.delete(phraseURLParam); - url.searchParams.append(phraseURLParam, encoded); + url.searchParams.delete(vpPhraseURLParam); + url.searchParams.append(vpPhraseURLParam, encoded); return url.toString(); } @@ -216,7 +216,7 @@ function getCode(vps: T.VPSelectionState): string { function getVPSFromUrl(): T.VPSelectionState | undefined { const params = new URLSearchParams(window.location.search); - const fromParams = params.get(phraseURLParam); + const fromParams = params.get(vpPhraseURLParam); if (!fromParams) return; const decoded = LZString.decompressFromEncodedURIComponent(fromParams); return JSON.parse(decoded) as T.VPSelectionState;