Skip to content

Commit

Permalink
fix: tring to fix wierd bug thats happening only in production, maybe…
Browse files Browse the repository at this point in the history
… more commits will come...
  • Loading branch information
Majortheus committed Feb 22, 2023
1 parent e8a2fa0 commit 271e39f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/components/OpenFilesTabs/CloseFileButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ export function CloseFileButton({ isActive, index }: CloseFileButtonProps) {
}

return (
<button
onClick={() => {
<a
onClick={(e) => {
e.preventDefault();
e.stopPropagation();
closeFile(index);
}}
className="w-[20px] h-[20px] flex justify-center items-center rounded hover:bg-[#817c9c26]"
Expand All @@ -41,6 +43,6 @@ export function CloseFileButton({ isActive, index }: CloseFileButtonProps) {
className="data-[active=true]:text-white"
size={16}
/>
</button>
</a>
)
}
2 changes: 1 addition & 1 deletion src/hooks/useOpenFiles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function OpenFilesProvider({ children }: { children: React.ReactNode }) {
return;
}

setOpenFiles([...openFiles, file]);
setOpenFiles(state => [...state, file]);
};

const closeFile = (fileIndex: number) => {
Expand Down

0 comments on commit 271e39f

Please sign in to comment.