From 7c204ce7338ae2346c5ba1415a043f49b3b34040 Mon Sep 17 00:00:00 2001 From: Maija Lintunokka Date: Thu, 10 Oct 2024 21:28:35 +0300 Subject: [PATCH] fix: rename reloadNostoWindow to reloadNosto --- spec/useLoadClientScript.spec.tsx | 4 ++-- src/hooks/useLoadClientScript.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/useLoadClientScript.spec.tsx b/spec/useLoadClientScript.spec.tsx index 8bd4191..df57c10 100644 --- a/spec/useLoadClientScript.spec.tsx +++ b/spec/useLoadClientScript.spec.tsx @@ -3,7 +3,7 @@ import { renderHook } from "@testing-library/react" import { useLoadClientScript } from "../src/hooks/useLoadClientScript" import scriptLoader from "../src/hooks/scriptLoader" import "@testing-library/jest-dom/vitest" -import { getNostoWindow, isNostoLoaded, reloadNostoWindow } from "@nosto/nosto-js" +import { getNostoWindow, isNostoLoaded, reloadNosto } from "@nosto/nosto-js" function loadClientScript(merchant: string) { const script = document.createElement("script") @@ -13,7 +13,7 @@ function loadClientScript(merchant: string) { script.async = true const promise = new Promise(resolve => { script.onload = () => { - reloadNostoWindow({ site: "localhost" }) + reloadNosto({ site: "localhost" }) resolve() } }) diff --git a/src/hooks/useLoadClientScript.ts b/src/hooks/useLoadClientScript.ts index 6542cfe..e0bfc7e 100644 --- a/src/hooks/useLoadClientScript.ts +++ b/src/hooks/useLoadClientScript.ts @@ -1,7 +1,7 @@ import { useState, useEffect } from "react" import type { NostoProviderProps } from "../components/NostoProvider" import scriptLoaderFn from "./scriptLoader" -import { init, initNostoStub, isNostoLoaded, nostojs, reloadNostoWindow } from "@nosto/nosto-js" +import { init, initNostoStub, isNostoLoaded, nostojs, reloadNosto } from "@nosto/nosto-js" type NostoScriptProps = Pick @@ -19,7 +19,7 @@ export function useLoadClientScript(props: NostoScriptProps) { function scriptOnload() { // Override for production scripts to work in unit tests if ("nostoReactTest" in window) { - reloadNostoWindow({ + reloadNosto({ site: "localhost" }) }