Skip to content

Commit

Permalink
fix: rename reloadNostoWindow to reloadNosto
Browse files Browse the repository at this point in the history
  • Loading branch information
maijalintunokka committed Oct 10, 2024
1 parent 9342392 commit 7c204ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/useLoadClientScript.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -13,7 +13,7 @@ function loadClientScript(merchant: string) {
script.async = true
const promise = new Promise<void>(resolve => {
script.onload = () => {
reloadNostoWindow({ site: "localhost" })
reloadNosto({ site: "localhost" })
resolve()
}
})
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useLoadClientScript.ts
Original file line number Diff line number Diff line change
@@ -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<NostoProviderProps, "account" | "host" | "shopifyMarkets" | "loadScript" | "scriptLoader">

Expand All @@ -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"
})
}
Expand Down

0 comments on commit 7c204ce

Please sign in to comment.