diff --git a/src/config/firebase.js b/src/config/firebase.js index f390901..331eab3 100644 --- a/src/config/firebase.js +++ b/src/config/firebase.js @@ -13,9 +13,12 @@ import { Platform } from "react-native"; const functionsInstances = {}; const emulatorConfigured = {}; const emulatorHost = Platform.OS === "web" ? "localhost" : "192.168.1.62"; +const USE_FUNCTIONS_EMULATOR = false; // Toggle to route functions traffic to the local emulator. const configureFunctionsEmulator = (instance, regionKey = "us-central1") => { - if (!__DEV__ || !instance?.useEmulator || emulatorConfigured[regionKey]) { + const shouldUseEmulator = USE_FUNCTIONS_EMULATOR && instance?.useEmulator; + + if (!shouldUseEmulator || emulatorConfigured[regionKey]) { return; } @@ -25,7 +28,7 @@ const configureFunctionsEmulator = (instance, regionKey = "us-central1") => { } catch (error) { console.warn( `[firebase] Unable to set functions emulator for region ${regionKey}`, - error?.message, + error?.message ); } }; diff --git a/src/screens/Writing/CustomizeSongStructure.web.js b/src/screens/Writing/CustomizeSongStructure.web.js index c8b4ebb..605a264 100644 --- a/src/screens/Writing/CustomizeSongStructure.web.js +++ b/src/screens/Writing/CustomizeSongStructure.web.js @@ -150,7 +150,7 @@ const reorder = (list, from, to) => { return next; }; -const clamp = (value, min, max) => Math.max(mn, Math.min(max, value)); +const clamp = (value, min, max) => Math.max(min, Math.min(max, value)); const CustomizeSongStructure = ({ baseStructure = [], onChange }) => { const [, setTooltip] = useGlobal("_tooltip");