format project
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
|
||||
|
||||
let timeoutId = 0
|
||||
const DelayedPingAnimation = ({isLoading: isLoading}: {isLoading: boolean}) => {
|
||||
const DelayedPingAnimation = ({
|
||||
isLoading: isLoading,
|
||||
}: {
|
||||
isLoading: boolean
|
||||
}) => {
|
||||
const [showLoading, setShowLoading] = React.useState(false)
|
||||
React.useEffect(() => {
|
||||
if (!isLoading && showLoading) {
|
||||
@@ -18,11 +20,12 @@ const DelayedPingAnimation = ({isLoading: isLoading}: {isLoading: boolean}) => {
|
||||
}
|
||||
}, [isLoading])
|
||||
|
||||
if (showLoading && isLoading) return (
|
||||
<div className="inset-0 absolute flex items-center justify-center">
|
||||
<div className="h-16 w-16 bg-pink-600 rounded-full animate-ping"></div>
|
||||
</div>
|
||||
)
|
||||
if (showLoading && isLoading)
|
||||
return (
|
||||
<div className="inset-0 absolute flex items-center justify-center">
|
||||
<div className="h-16 w-16 bg-pink-600 rounded-full animate-ping"></div>
|
||||
</div>
|
||||
)
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import { requestRender } from 'src/helpers/hooks/useIdeState'
|
||||
import texture from './dullFrontLitMetal.png'
|
||||
import { TextureLoader } from 'three/src/loaders/TextureLoader'
|
||||
import Customizer from 'src/components/Customizer/Customizer'
|
||||
import DelayedPingAnimation from 'src/components/DelayedPingAnimation/DelayedPingAnimation'
|
||||
import DelayedPingAnimation from 'src/components/DelayedPingAnimation/DelayedPingAnimation'
|
||||
|
||||
const loader = new TextureLoader()
|
||||
const colorMap = loader.load(texture)
|
||||
|
||||
@@ -129,7 +129,11 @@ export const render: DefaultKernelExport['render'] = async ({
|
||||
scriptWorker.postMessage({ action: 'init', baseURI, alias: [] })
|
||||
}
|
||||
|
||||
if (parameters && currentParameters && JSON.stringify(parameters) !== JSON.stringify(currentParameters)) {
|
||||
if (
|
||||
parameters &&
|
||||
currentParameters &&
|
||||
JSON.stringify(parameters) !== JSON.stringify(currentParameters)
|
||||
) {
|
||||
// we are not evaluating code, but reacting to parameters change
|
||||
scriptWorker.postMessage({
|
||||
action: 'updateParams',
|
||||
|
||||
@@ -160,7 +160,7 @@ export function genParams(
|
||||
if (inp.getAttribute('live') === '1') _callback('live')
|
||||
})
|
||||
if (inp.getAttribute('live') !== '1')
|
||||
inp.addEventListener('change', ()=>_callback('change'))
|
||||
inp.addEventListener('change', () => _callback('change'))
|
||||
})
|
||||
|
||||
function groupClick(evt) {
|
||||
|
||||
@@ -175,7 +175,11 @@ export const useIdeState = (): [State, (actionOrThunk: any) => any] => {
|
||||
case 'updateCode':
|
||||
return { ...state, code: payload }
|
||||
case 'healthyRender':
|
||||
const currentParameters = (payload.currentParameters && Object.keys(payload.currentParameters).length) ? payload.currentParameters : state.currentParameters
|
||||
const currentParameters =
|
||||
payload.currentParameters &&
|
||||
Object.keys(payload.currentParameters).length
|
||||
? payload.currentParameters
|
||||
: state.currentParameters
|
||||
return {
|
||||
...state,
|
||||
objectData: {
|
||||
|
||||
Reference in New Issue
Block a user