Skip to content

Commit

Permalink
feat/fix: auto open template contract in editor (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 authored Jun 21, 2024
1 parent 71f1b30 commit f24cd10
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/workspace/WorkSpace/WorkSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ const WorkSpace: FC = () => {
}
createLog(`Project '${activeProject?.name}' is opened`);
createSandbox(true);

if (activeFile) return;
const projectFiles = workspaceAction.projectFiles(activeProject.id);
const mainFile = projectFiles.find((file) =>
['main.tact', 'main.fc'].includes(file.name)
);
if (!mainFile) return;
workspaceAction.openFile(mainFile?.id, activeProject.id);
}, [activeProject]);

useEffect(() => {
Expand Down

0 comments on commit f24cd10

Please sign in to comment.