Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ function App() {
const model = editor.getModel()!;
const range = model.getFullModelRange();

// If there are at least 10 lines of code, ask for confirmation.
if (range.endLineNumber >= 10 && !confirmed) {
// If editor contains more than the initial line of code, ask for confirmation.
if (range.endLineNumber > 1 && !confirmed) {
setReadCodeConfirmOpen(true);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/ReadCodeConfirm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ function ReadCodeConfirm({ isOpen, onClose, onConfirm }: ReadCodeConfirmProps) {
>
<AlertDialogOverlay>
<AlertDialogContent>
<AlertDialogHeader>Clear editor</AlertDialogHeader>
<AlertDialogHeader>Replace editor content?</AlertDialogHeader>

<AlertDialogBody>
Opening Rustpad's source code will clear the existing shared
Opening Rustpad's source code will replace the existing shared
content. Is this okay?
</AlertDialogBody>

Expand All @@ -39,7 +39,7 @@ function ReadCodeConfirm({ isOpen, onClose, onConfirm }: ReadCodeConfirmProps) {
Cancel
</Button>
<Button colorScheme="red" onClick={onConfirm} ml={3}>
Clear
Replace
</Button>
</AlertDialogFooter>
</AlertDialogContent>
Expand Down
Loading