Skip to content

Commit

Permalink
chore: transform default context vars uppercase
Browse files Browse the repository at this point in the history
  • Loading branch information
nzambello committed Apr 17, 2024
1 parent 79be3bf commit 7627eb1
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions src/components/MemoriWidget/MemoriWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2381,8 +2381,9 @@ const MemoriWidget = ({
tag: personification?.tag,
pin: personification?.pin,
initialContextVars: {
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname?.split('/')?.pop()?.toUpperCase() || '',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down Expand Up @@ -2481,8 +2482,10 @@ const MemoriWidget = ({
memori?.giverTag,
memori?.giverPIN,
{
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname?.split('/')?.pop()?.toUpperCase() ||
'',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down Expand Up @@ -2532,8 +2535,10 @@ const MemoriWidget = ({
personification.tag,
personification.pin,
{
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname?.split('/')?.pop()?.toUpperCase() ||
'',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down Expand Up @@ -2583,8 +2588,10 @@ const MemoriWidget = ({
undefined,
undefined,
{
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname?.split('/')?.pop()?.toUpperCase() ||
'',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down Expand Up @@ -2959,8 +2966,10 @@ const MemoriWidget = ({
instruct ? memori.giverTag : personification?.tag,
instruct ? memori.giverPIN : personification?.pin,
{
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname?.split('/')?.pop()?.toUpperCase() ||
'',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down Expand Up @@ -2998,8 +3007,12 @@ const MemoriWidget = ({
instruct ? memori.giverTag : personification?.tag,
instruct ? memori.giverPIN : personification?.pin,
{
PATHNAME: window.location.pathname,
ROUTE: window.location.pathname?.split('/')?.pop() || '',
PATHNAME: window.location.pathname?.toUpperCase(),
ROUTE:
window.location.pathname
?.split('/')
?.pop()
?.toUpperCase() || '',
...(initialContextVars || {}),
},
initialQuestion,
Expand Down

0 comments on commit 7627eb1

Please sign in to comment.