Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into actual-story-page-camera
Browse files Browse the repository at this point in the history
  • Loading branch information
KaWaite committed Sep 21, 2023
2 parents b8e62ee + bb362bb commit dd22a26
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion web/src/beta/features/Editor/DataSourceManager/Asset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ const Asset: React.FC<DataProps> = ({ sceneId, onSubmit, onClose }) => {
);

const handleSubmit = () => {
let parsedValue = null;

if (sourceType === "value" && value !== "") {
try {
parsedValue = JSON.parse(value);
} catch (error) {
parsedValue = value;
}
}
onSubmit({
layerType: "simple",
sceneId,
Expand All @@ -59,7 +68,7 @@ const Asset: React.FC<DataProps> = ({ sceneId, onSubmit, onClose }) => {
data: {
url: sourceType === "url" && value !== "" ? value : null,
type: fileFormat.toLowerCase(),
value: sourceType === "value" && value !== "" ? value : null,
value: parsedValue,
},
resource: {
clampToGround: true,
Expand Down

0 comments on commit dd22a26

Please sign in to comment.