Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8c8e335

Browse files
bug fix
1 parent 811be33 commit 8c8e335

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

‎src/components/editorBar/EditorBar.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const EditorBar = () => {
88
const handleCloseTab = (e: React.MouseEvent<HTMLDivElement>) => {
99
e.stopPropagation();
1010
const filename = (e.target as HTMLDivElement).parentElement!.innerText;
11-
if (e.isTrusted) {
11+
if (e.isTrusted&&editorState.tabs.length>1) {
1212
const args: any = {};
1313
args.tabs = [...editorState.tabs.filter((tab) => tab !== filename)];
1414
if (!editorState.activeTab) {

‎src/components/fileExplorer/FileExplorer.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ const FileExplorer: FC = () => {
2222
const handlDeleteFile = (e: React.MouseEvent<HTMLDivElement>) => {
2323
e.stopPropagation();
2424
const filename = (e.target as HTMLDivElement).parentElement!.innerText;
25+
if (editorState.files.length === 1)
26+
return alert("There should be atleast 1 file.");
2527
if (e.isTrusted && window.confirm(`Delete file ${filename}?`) === true) {
2628
const args: any = {};
2729
args.tabs = [...editorState.tabs.filter((tab) => tab !== filename)];

‎src/components/webRender/WebRender.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ const WebRender = () => {
1010
const timeout = setTimeout(() => {
1111
setSrcDoc(`
1212
<html>
13-
<body>${code["index.html"]}</body>
14-
<style>${code["style.css"]}</style>
15-
<script>${code["app.js"]}</script>
13+
<body>${code["index.html"]||""}</body>
14+
<style>${code["style.css"]||""}</style>
15+
<script>${code["app.js"]||""}</script>
1616
</html>
1717
`);
1818
}, 1000);

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /