Skip to content

Commit

Permalink
Merge pull request #65 from munrocket/fix-fork
Browse files Browse the repository at this point in the history
Fix loss of original shader with fork
  • Loading branch information
davidar authored Nov 23, 2023
2 parents e903c6b + 3fad843 commit a4967d1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/editor/metadataeditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const MetadataEditor = () => {
const [title, setTitle] = useAtom(titleAtom);
const [description, setDescription] = useAtom(descriptionAtom);
const [visibility, setVisibility] = useAtom(visibilityAtom);
const shaderID = useAtomValue(shaderIDAtom);
const [shaderID, setShaderID] = useAtom(shaderIDAtom);
const setShaderDataUrlThumb = useSetAtom(shaderDataUrlThumbAtom);
const shadowCanvasEl = useAtomValue(shadowCanvasElAtom);
const canvasEl = useAtomValue(canvasElAtom);
Expand All @@ -65,7 +65,10 @@ export const MetadataEditor = () => {
if (result.success) {
setCodeNeedSave(false);
if (result.needsRedirect) {
setTimeout(() => router.push(`/view/${result.id}`), 0);
setTimeout(() => {
setShaderID(result.id);
router.push(`/view/${result.id}`);
}, 0);
}
}
};
Expand Down

0 comments on commit a4967d1

Please sign in to comment.