Skip to content

Commit

Permalink
fix: examples not being correctly replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
lajbel committed Nov 3, 2024
1 parent 419fdd2 commit 9f08f29
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion kaplay
4 changes: 1 addition & 3 deletions src/components/Playground/Playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ const Playground = () => {
kaplayVersion: DEFAULT_KAPLAY_VERSION,
name: "Shared Example",
version: "2.0.0",
isDefault: true,
isDefault: false,
});

loadProject("shared");
setLoadingProject(false);

return;
};

Expand Down
5 changes: 1 addition & 4 deletions src/components/Toolbar/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import { downloadBlob } from "../../util/download";
import ToolbarButton from "./ToolbarButton";

const Projects: FC = () => {
const { project, createNewProject, importProject, loadProject } =
useProject();
const { project, createNewProject, importProject } = useProject();
const { update, run, showNotification } = useEditor();

const handleDownload = () => {
Expand Down Expand Up @@ -61,8 +60,6 @@ const Projects: FC = () => {
files: fileMap,
assets: assetMap,
});

loadProject(project.state.project.id);
};

reader.readAsText(file);
Expand Down
4 changes: 2 additions & 2 deletions src/stores/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ export const createProjectSlice: StateCreator<
name: project.name,
});

useProject.persist.rehydrate();

set(() => ({
project: {
...project,
},
}));

useProject.persist.rehydrate();
},
createNewExampleProject() {
},
Expand Down

0 comments on commit 9f08f29

Please sign in to comment.