Skip to content

Commit

Permalink
Auto add stencils
Browse files Browse the repository at this point in the history
  • Loading branch information
b-j-roberts committed Feb 22, 2025
1 parent 3876b72 commit 3e7d709
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend-next/src/components/tabs/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const TabPanel = (props: any) => {
stencilCreationSelected={props.stencilCreationSelected}
setActiveTab={props.setActiveTab}
stencilColorIds={props.stencilColorIds}
setOpenedStencil={props.setOpenedStencil}
/>
</CSSTransition>
<CSSTransition
Expand Down
13 changes: 13 additions & 0 deletions frontend-next/src/components/tabs/stencil-creation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ export const StencilCreationTab = (props: any) => {
console.log("Stencil added to DB:", res);
props.endStencilCreation();
props.setActiveTab("Stencils");
const imgHash = hash.substr(2).padStart(64, "0");
const newStencil = {
favorited: true,
favorites: 1,
hash: imgHash,
height: props.stencilImage.height,
name: "",
position: props.stencilPosition,
stencilId: res.stencilId,
width: props.stencilImage.width,
worldId: props.worldId,
};
props.setOpenedStencil(newStencil);
};

return (
Expand Down

0 comments on commit 3e7d709

Please sign in to comment.