Skip to content

Commit

Permalink
fix: use correct toolbar URL (new=true)
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Dec 16, 2021
1 parent 60967b8 commit 8de749c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/PrismicToolbar.tsx
Expand Up @@ -27,7 +27,7 @@ export const PrismicToolbar = ({
type = "new",
}: PrismicToolbarProps): null => {
const src = `https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}${
type === "new" ? "&type=new" : ""
type === "new" ? "&new=true" : ""
}`;

React.useEffect(() => {
Expand Down
4 changes: 2 additions & 2 deletions test/PrismicToolbar.test.tsx
Expand Up @@ -33,7 +33,7 @@ test.serial(
if (script instanceof HTMLScriptElement) {
t.is(
script.getAttribute("src"),
`https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}&type=new`,
`https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}&new=true`,
);
t.is(script.getAttribute("defer"), "");
t.is(script.dataset.repositoryName, repositoryName);
Expand All @@ -54,7 +54,7 @@ test.serial("uses the new toolbar by default", (t) => {
if (script instanceof HTMLScriptElement) {
t.is(
script.getAttribute("src"),
`https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}&type=new`,
`https://static.cdn.prismic.io/prismic.js?repo=${repositoryName}&new=true`,
);
t.is(script.dataset.type, "new");
} else {
Expand Down

0 comments on commit 8de749c

Please sign in to comment.