format project

This commit is contained in:
Kurt Hutten
2021-08-08 19:55:05 +10:00
parent 802ea61639
commit 078c79d8ee
5 changed files with 23 additions and 12 deletions

View File

@@ -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,7 +20,8 @@ const DelayedPingAnimation = ({isLoading: isLoading}: {isLoading: boolean}) => {
}
}, [isLoading])
if (showLoading && isLoading) return (
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>

View File

@@ -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',

View File

@@ -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: {