Product: LB-Phone
Issue: getSettings() and onSettingsChange() seems to send the old value
How to recreate: Use the following react component. This was taken from the custom app react template
import React, { useEffect, useRef } from 'react'
import './App.css'
export const devMode = !window?.['invokeNative']
const App = () => {
const appDiv = useRef(null)
const { getSettings, onSettingsChange, fetchNui, sendNotification } = window as any
useEffect(() => {
if (devMode) {
document.getElementsByTagName('html')[0].style.visibility = 'visible'
document.getElementsByTagName('body')[0].style.visibility = 'visible'
return
} else {
getSettings().then((settings: any) => {
sendNotification({ content: `${settings.sound.volume}`, title: "App open" })
})
onSettingsChange((settings: any) => {
sendNotification({ content: `${settings.sound.volume}`, title: 'Settings changed' })
})
}
}, [])
return (
<AppProvider>
<div className='app' ref={appDiv}>
<p>TEST</p>
</div>
</AppProvider>
)
}
interface Props {
children: React.ReactNode
}
const AppProvider: React.FC<Props> = ({ children }) => {
if (devMode) {
return <div className='dev-wrapper'>{children}</div>
} else return children
}
export default App
Attachment: https://streamable.com/8anln9
Version: 1.7.2
Framework: Standalone
Has this bug appeared more than once? Everytime