Skip to content

Commit 56961d7

Browse files
Update global value on Audio Source component (#1119)
* feat: update global value & validate source input only where there's a value * feat: remove debugger
1 parent 407e90f commit 56961d7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/@dcl/inspector/src/components/EntityInspector/AudioSourceInspector/utils.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export const fromAudioSource =
1313
audioClipUrl: removeBasePath(base, value.audioClipUrl),
1414
loop: value.loop,
1515
playing: value.playing,
16-
volume: volumeFromAudioSource(value.volume)
16+
volume: volumeFromAudioSource(value.volume),
17+
global: value.global
1718
}
1819
}
1920

@@ -24,7 +25,8 @@ export const toAudioSource =
2425
audioClipUrl: base ? base + '/' + value.audioClipUrl : value.audioClipUrl,
2526
loop: value.loop,
2627
playing: value.playing,
27-
volume: volumeToAudioSource(value.volume)
28+
volume: volumeToAudioSource(value.volume),
29+
global: value.global
2830
}
2931
}
3032

packages/@dcl/inspector/src/components/ui/FileUploadField/FileUploadField.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ const FileUploadField: React.FC<Props> = ({
176176
label={label}
177177
onChange={handleChangeTextField}
178178
value={removeBase(path)}
179-
error={hasError}
179+
error={!!value && hasError}
180180
disabled={disabled}
181181
drop={isHover}
182182
autoSelect
@@ -188,7 +188,7 @@ const FileUploadField: React.FC<Props> = ({
188188
</button>
189189
)}
190190
</div>
191-
{hasError && <Message text={errorMessage} type={MessageType.ERROR} />}
191+
{!!value && hasError && <Message text={errorMessage} type={MessageType.ERROR} />}
192192
</div>
193193
)
194194
}

0 commit comments

Comments
 (0)