Skip to content

Commit

Permalink
Release 2.0.99-b3
Browse files Browse the repository at this point in the history
  • Loading branch information
YeonV committed Jul 10, 2024
1 parent d0e02f0 commit b40e906
Show file tree
Hide file tree
Showing 51 changed files with 93 additions and 31 deletions.
1 change: 0 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default [
}
],
'react-hooks/rules-of-hooks': 'warn',
'react-hooks/exhaustive-deps': 'warn',
'@typescript-eslint/no-unused-vars': [
'warn',
{
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ledfx",
"version": "2.0.99-b2",
"version": "2.0.99-b3",
"description": "LedFx v2 - BladeMOD",
"author": "YeonV aka Blade",
"private": true,
Expand Down Expand Up @@ -111,15 +111,15 @@
"packs": "electron-builder --dir",
"dist": "run-script-os",
"predist": "node -e \"let pkg=require('./package.json'); pkg.homepage='.'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\"",
"dist:win32": "set GENERATE_SOURCEMAP=false && react-scripts build && electron-builder --config electron-builder.json -w zip -w portable -w nsis",
"dist:default": "GENERATE_SOURCEMAP=false react-scripts build && electron-builder --config electron-builder.json",
"dist:win32": "set GENERATE_SOURCEMAP=false && set CI=false && react-scripts build && electron-builder --config electron-builder.json -w zip -w portable -w nsis",
"dist:default": "GENERATE_SOURCEMAP=false CI=false react-scripts build && electron-builder --config electron-builder.json",
"distsetup": "run-script-os",
"predistsetup": "node -e \"let pkg=require('./package.json'); pkg.homepage='.'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\"",
"distsetup:win32": "set GENERATE_SOURCEMAP=false && set MS_STORE=true && react-scripts build && electron-builder --config electron-builder.json -w nsis",
"distsetup:default": "GENERATE_SOURCEMAP=false MS_STORE=true react-scripts build && electron-builder --config electron-builder.json",
"distcc": "run-script-os",
"predistcc": "node -e \"let pkg=require('./package.json'); pkg.homepage='.'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\"",
"distcc:win32": "set GENERATE_SOURCEMAP=false && react-scripts build && electron-builder",
"distcc:win32": "set GENERATE_SOURCEMAP=false && set CI=false && react-scripts build && electron-builder",
"distcc:default": "GENERATE_SOURCEMAP=false react-scripts build && electron-builder",
"distall": "run-script-os",
"predistall": "set PUBLIC_URL=. && node -e \"let pkg=require('./package.json'); pkg.homepage='.'; require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));\"",
Expand Down
9 changes: 5 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function App() {
const getSchemas = useStore((state) => state.getSchemas)
const shutdown = useStore((state) => state.shutdown)
const showSnackbar = useStore((state) => state.ui.showSnackbar)
const darkMode = useStore((state) => state.ui.darkMode)
// const darkMode = useStore((state) => state.ui.darkMode)
const setCoreParams = useStore((state) => state.setCoreParams)
const setCoreStatus = useStore((state) => state.setCoreStatus)

Expand All @@ -52,7 +52,7 @@ export default function App() {
// },
}
}),
[darkMode]
[]
)

useEffect(() => {
Expand All @@ -65,6 +65,7 @@ export default function App() {
initFrontendConfig()

console.info(
// eslint-disable-next-line no-useless-concat
'%c Ledfx ' + '%c\n ReactApp by Blade ',
'padding: 10px 40px; color: #ffffff; border-radius: 5px 5px 0 0; background-color: #800000;',
'background: #fff; color: #800000; border-radius: 0 0 5px 5px;padding: 5px 0;'
Expand Down Expand Up @@ -121,7 +122,7 @@ export default function App() {
return () => {
document.removeEventListener('show_message', handleWebsockets)
}
}, [])
}, [showSnackbar])

useEffect(() => {
if (protoCall !== '') {
Expand Down Expand Up @@ -152,7 +153,7 @@ export default function App() {
}
setProtoCall('')
}
}, [protoCall, showSnackbar])
}, [protoCall, showSnackbar, setProtoCall])

return (
<ThemeProvider theme={theme}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Bars/BarMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const MessageBar = () => {
if (typeof message === 'string' && message.startsWith('Created Virtual ')) {
setCurrentVirtual(message.replace('Created Virtual ', ''))
}
}, [message])
}, [message, setCurrentVirtual])

return (
<Snackbar
Expand Down
6 changes: 4 additions & 2 deletions src/components/Bars/BarTop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ const TopBar = () => {

useEffect(() => {
setIsLogged(!!localStorage.getItem('jwt'))
}, [pathname])
}, [pathname, setIsLogged])

const getUpdateInfo = useStore((state) => state.getUpdateInfo)

Expand Down Expand Up @@ -295,7 +295,7 @@ const TopBar = () => {
}

checkForUpdates()
}, [updateNotificationInterval])
}, [updateNotificationInterval, getUpdateInfo, latestTag])

useEffect(() => {
const latest = async () => {
Expand All @@ -306,6 +306,7 @@ const TopBar = () => {
return resp.tag_name as string
}
latest().then((r) => r !== latestTag && setLatestTag(r))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {
Expand All @@ -326,6 +327,7 @@ const TopBar = () => {
return () => {
document.removeEventListener('disconnected', handleDisconnect)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/Dialogs/AboutDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ export default function AboutDialog({ className, children, startIcon }: any) {

if (open) {
fetchData()
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open])

return (
Expand Down
1 change: 1 addition & 0 deletions src/components/Dialogs/AddVirtualDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ const AddVirtualDialog = () => {

useEffect(() => {
handleModelChange(initial.config)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [virtId, initial.config])

return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dialogs/AddWledDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ const AddWledDialog = () => {
})
}


// eslint-disable-next-line react-hooks/exhaustive-deps
const col: GridColDef[] = [
{ field: 'name', headerName: 'Name', width: 130 },
{ field: 'ip_address', headerName: 'IP', width: 130 }
Expand All @@ -123,6 +125,7 @@ const AddWledDialog = () => {
width: 100
}
],
// eslint-disable-next-line react-hooks/exhaustive-deps
[col]
)
return (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dialogs/EffectTypeDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const EffectTypeDialog = ({
)
.filter((e: any) => !!e?.value)
],
[groups, formats]
[groups]
)

return (
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dialogs/FrontendPixelsTooSmall.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,13 @@ export default function FrontendPixelsTooSmall() {

useEffect(() => {
getSystemConfig()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {
getSystemConfig()
setPixelLength(fPixels)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [fPixels])

return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dialogs/HostManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export default function HostManager() {
useEffect(() => {
if (storedURL) setHostvalue(storedURL)
if (storedURLs) setHosts(storedURLs)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [storedURL, setHosts])

useEffect(() => {
Expand All @@ -101,6 +102,7 @@ export default function HostManager() {
// eslint-disable-next-line no-self-assign
window.location.href = window.location.href
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
const runningCores = Object.keys(coreStatus)
.filter((h) => coreStatus[h] === 'running')
Expand Down Expand Up @@ -158,6 +160,7 @@ export default function HostManager() {
}

getCommonScenes(runningCores).then((res) => setCommonScenes(res))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [coreStatus, coreParams])
// console.log(commonScenes)
const activateCommon = async (scene: string) => {
Expand Down
2 changes: 2 additions & 0 deletions src/components/Dialogs/IntroDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export default function IntroDialog({

useEffect(() => {
getSystemConfig()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

const [s, setS] = useState({} as Record<string, 'left' | 'right'>)
Expand Down Expand Up @@ -250,6 +251,7 @@ export default function IntroDialog({
].filter((n: any) => n !== false)

setSteps(ste)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [s, graphsMulti, assistant])

return (
Expand Down
1 change: 1 addition & 0 deletions src/components/Dialogs/NoHostDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default function NoHostDialog() {
// eslint-disable-next-line no-self-assign
window.location.href = window.location.href
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
Expand Down
3 changes: 3 additions & 0 deletions src/components/Dialogs/SceneDialogs/EditSceneDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ const EditSceneDialog = () => {
ic.split('image:')[1]?.replaceAll('file:///', '')
)
setImageData(result.image)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {
Expand Down Expand Up @@ -219,6 +220,7 @@ const EditSceneDialog = () => {
getLedFxPresets().then(setLedFxPresets)
getUserPresets().then(setUserPresets)
if (open) activateScene(data.name?.toLowerCase().replaceAll(' ', '-'))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open])

useEffect(() => {
Expand Down Expand Up @@ -247,6 +249,7 @@ const EditSceneDialog = () => {
}
})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

const renderPresets = (
Expand Down
1 change: 1 addition & 0 deletions src/components/Gamepad/Gamepad.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ const Gamepad = ({ setScene, bottom }: any) => {
})
)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [pad0, pad1, pad2, pad3])

return gp ? (
Expand Down
2 changes: 2 additions & 0 deletions src/components/Integrations/QLC/QLCTriggerTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function QLCTriggerTable() {

useEffect(() => {
getQLCWidgets()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

// Here we get the current triggers from list and set to global state
Expand Down Expand Up @@ -96,6 +97,7 @@ export default function QLCTriggerTable() {
})
addToQLCTriggerList(triggersNew, 'create')
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [integrations])

const deleteTriggerHandler = (paramsTemp: any) => {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Integrations/Spotify/SpotifyAuthButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const SpotifyAuthButton = ({ disabled = false }: any) => {
if (cookies.get('access_token')) {
setspAuthenticated(true)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
const beginAuth = () => {
cookies.set('verifier', (codes as any).verifier)
Expand Down Expand Up @@ -112,6 +113,7 @@ const SpotifyAuthButton = ({ disabled = false }: any) => {
console.warn(err)
}
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

useEffect(() => {
Expand All @@ -121,6 +123,7 @@ const SpotifyAuthButton = ({ disabled = false }: any) => {
} else {
setspAuthenticated(false)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [cookies])

return !spAuthenticated ? (
Expand Down
10 changes: 5 additions & 5 deletions src/components/Integrations/Spotify/SpotifyProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,8 @@ const SpotifyProvider = ({ children }: ISpotifyProviderProps) => {
}
triggersNew.sort((a, b) => a.position_ms - b.position_ms)
setCurrentTriggers(triggersNew)
}, [
spotifyState?.track_window?.current_track?.id,
sceneTriggers.length,
spState?.item?.id
])
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [spotifyState?.track_window?.current_track?.id,sceneTriggers.length,spState?.item?.id])

useEffect(() => {
if (
Expand All @@ -166,7 +163,9 @@ const SpotifyProvider = ({ children }: ISpotifyProviderProps) => {
const update = setInterval(updateState, 1000)

return () => clearInterval(update)
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [player, spotifyState?.paused, integrations])

useEffect(() => {
if (integrations.spotify?.status === 0 || !integrations.spotify?.active)
return
Expand Down Expand Up @@ -233,6 +232,7 @@ const SpotifyProvider = ({ children }: ISpotifyProviderProps) => {
if (!spotifyAuthToken && player) {
setPlayer(undefined)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [spotifyAuthToken, integrations.spotify?.active])

if (currentSceneTriggers.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export default function SpAudioFeatures() {
setSpotifyData('Artist', res)
})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [meta])

const audioFeaturesKey = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export default function SpSceneTrigger() {

useEffect(() => {
getScenes()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default function SpTrack({ className }: any) {
setPlaylist(r.items)
})
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [spotifyCtx?.context?.metadata?.uri, spCtx?.context?.uri])

const album =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ export default function SpotifyTriggerTable() {
useEffect(() => {
getSpTriggers()
getScenes()
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])

// Here we get the current triggers from list and set to global state
Expand Down Expand Up @@ -130,6 +131,7 @@ export default function SpotifyTriggerTable() {
})
addToSpTriggerList(triggersNew, 'create')
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [integrations])

const updateSpTrigger = (rowData: any, val: any) => {
Expand Down
1 change: 1 addition & 0 deletions src/components/MGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const MGraph = () => {
return () => {
document.removeEventListener('graph_update', handleWebsockets)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [animationDuration, fillOpacity, scaleType])

return (
Expand Down
1 change: 1 addition & 0 deletions src/components/MidiInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const MIDIListener = () => {
// webSocket.removeEventListener('open', handleOpen)
webSocket.removeEventListener('message', handleMessage)
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [scenes, sceneDialogOpen])

return null
Expand Down
Loading

0 comments on commit b40e906

Please sign in to comment.