diff --git a/src/puter-js/src/index.js b/src/puter-js/src/index.js index 52faa4c6bb..6c47702620 100644 --- a/src/puter-js/src/index.js +++ b/src/puter-js/src/index.js @@ -101,6 +101,7 @@ const puterInit = (function () { #defaultAPIOrigin = 'https://api.puter.com'; #defaultGUIOrigin = 'https://puter.com'; + #overrideDefaultGUIOrigin = undefined; get defaultAPIOrigin () { return globalThis.PUTER_API_ORIGIN || globalThis.PUTER_API_ORIGIN_ENV || this.#defaultAPIOrigin; @@ -110,10 +111,11 @@ const puterInit = (function () { } get defaultGUIOrigin () { - return globalThis.PUTER_ORIGIN || globalThis.PUTER_ORIGIN_ENV || this.#defaultGUIOrigin; + return this.#overrideDefaultGUIOrigin || globalThis.PUTER_ORIGIN || globalThis.PUTER_ORIGIN_ENV || this.#defaultGUIOrigin; } set defaultGUIOrigin (v) { - this.#defaultGUIOrigin = v; + // this.#defaultGUIOrigin = v; + this.#overrideDefaultGUIOrigin = v; } // An optional callback when the user is authenticated. This can be set by the app using the SDK.