+
17 ? 'settings-text-container-long' : ''}`} style={{ width }} {...divProps}>
= ({
diff --git a/src/react/TouchAreasControls.tsx b/src/react/TouchAreasControls.tsx
index ec9d201b..469097bd 100644
--- a/src/react/TouchAreasControls.tsx
+++ b/src/react/TouchAreasControls.tsx
@@ -1,5 +1,6 @@
import { CSSProperties, PointerEvent, useEffect, useRef, useState } from 'react'
import { proxy, ref, useSnapshot } from 'valtio'
+import activatableItemsMobile from 'mineflayer-mouse/dist/activatableItemsMobile'
import { contro } from '../controls'
import { options } from '../optionsStorage'
import PixelartIcon from './PixelartIcon'
@@ -72,10 +73,12 @@ export default ({ setupActive, closeButtonsSetup, foregroundGameActive }: Props)
break: false,
jump: bot?.getControlState('jump'),
}[name]
+ const RIGHT_MOUSE_BUTTON = 2
+ const LEFT_MOUSE_BUTTON = 0
const holdDown = {
action () {
if (!bot) return
- document.dispatchEvent(new MouseEvent('mousedown', { button: 2 }))
+ document.dispatchEvent(new MouseEvent('mousedown', { button: RIGHT_MOUSE_BUTTON }))
bot.mouse.update()
},
sneak () {
@@ -87,7 +90,7 @@ export default ({ setupActive, closeButtonsSetup, foregroundGameActive }: Props)
},
break () {
if (!bot) return
- document.dispatchEvent(new MouseEvent('mousedown', { button: 0 }))
+ document.dispatchEvent(new MouseEvent('mousedown', { button: LEFT_MOUSE_BUTTON }))
bot.mouse.update()
active = true
},
@@ -101,7 +104,7 @@ export default ({ setupActive, closeButtonsSetup, foregroundGameActive }: Props)
}
const holdUp = {
action () {
- document.dispatchEvent(new MouseEvent('mouseup', { button: 2 }))
+ document.dispatchEvent(new MouseEvent('mouseup', { button: RIGHT_MOUSE_BUTTON }))
},
sneak () {
void contro.emit('release', {
@@ -112,7 +115,7 @@ export default ({ setupActive, closeButtonsSetup, foregroundGameActive }: Props)
},
break () {
if (!bot) return
- document.dispatchEvent(new MouseEvent('mouseup', { button: 0 }))
+ document.dispatchEvent(new MouseEvent('mouseup', { button: LEFT_MOUSE_BUTTON }))
bot.mouse.update()
active = false
},
diff --git a/src/react/appStorageProvider.ts b/src/react/appStorageProvider.ts
index bce6feca..fd469186 100644
--- a/src/react/appStorageProvider.ts
+++ b/src/react/appStorageProvider.ts
@@ -91,6 +91,14 @@ const setCookieValue = (key: string, value: string): boolean => {
}
document.cookie = cookie
+
+ // Verify the cookie was actually saved by reading it back
+ const savedValue = getCookieValue(key)
+ if (savedValue !== value) {
+ console.warn(`Cookie verification failed for key '${key}'. Expected: ${value}, Got: ${savedValue}`)
+ return false
+ }
+
return true
} catch (error) {
console.error(`Failed to set cookie for key '${key}':`, error)
@@ -229,12 +237,19 @@ export const getRandomUsername = (appConfig: AppConfig) => {
export const appStorage = proxy({ ...defaultStorageData })
+// Track if cookies failed in this session
+let cookiesFailedThisSession = false
+
// Check if cookie storage should be used (will be set by options)
const shouldUseCookieStorage = () => {
- const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)
+ // If cookies failed this session, don't try again
+ if (cookiesFailedThisSession) {
+ return false
+ }
+
const isSecureCookiesAvailable = () => {
// either https or localhost
- return window.location.protocol === 'https:' || (window.location.hostname === 'localhost' && !isSafari)
+ return window.location.protocol === 'https:' || (window.location.hostname === 'localhost')
}
if (!isSecureCookiesAvailable()) {
return false
@@ -345,8 +360,10 @@ const saveKey = (key: keyof StorageData) => {
// Remove from localStorage if cookie save was successful
markLocalStorageAsMigrated(key)
} else {
- // Disabling for now so no confusing conflicts modal after page reload
- // useLocalStorage = true
+ // Cookie save failed, disable cookies for this session and fallback to localStorage
+ console.warn(`Cookie save failed for key '${key}', disabling cookies for this session`)
+ cookiesFailedThisSession = true
+ useLocalStorage = true
}
}
}
diff --git a/src/reactUi.tsx b/src/reactUi.tsx
index b15cb79d..6339686e 100644
--- a/src/reactUi.tsx
+++ b/src/reactUi.tsx
@@ -66,6 +66,9 @@ import CreditsAboutModal from './react/CreditsAboutModal'
import GlobalOverlayHints from './react/GlobalOverlayHints'
import FullscreenTime from './react/FullscreenTime'
import StorageConflictModal from './react/StorageConflictModal'
+import FireRenderer from './react/FireRenderer'
+import MonacoEditor from './react/MonacoEditor'
+import OverlayModelViewer from './react/OverlayModelViewer'
const isFirefox = ua.getBrowser().name === 'Firefox'
if (isFirefox) {
@@ -171,6 +174,7 @@ const InGameUi = () => {
+ {!disabledUiParts.includes('fire') &&
}
@@ -246,7 +250,6 @@ const App = () => {