Skip to content

Commit

Permalink
Don't show conversion overlay on run (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
rob-gordon authored Jul 26, 2024
1 parent c099bae commit cf5435b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions app/src/components/ConvertOnPasteOverlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export function ConvertOnPasteOverlay() {
}
}, [userPasted]);

const convertIsRunning = usePromptStore((s) => s.isRunning);

// Qualities for displaying Convert to Flowchart button:
// OR
// Convert is currently running
Expand All @@ -47,8 +45,7 @@ export function ConvertOnPasteOverlay() {
// Full text is selected and is more than 150 characters
// Less than 15 seconds have passed since user pasted more than 150 characters
const showConvertToFlowchart =
convertIsRunning ||
(!isDefaultText && enoughCharacters && lastResult !== text && userPasted);
!isDefaultText && enoughCharacters && lastResult !== text && userPasted;

if (showConvertToFlowchart) return <Overlay />;

Expand Down
1 change: 1 addition & 0 deletions app/src/components/TextEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export function TextEditor({
editor.onDidPaste((e) => {
// get the text in the range
const text = editor.getModel()?.getValueInRange(e.range);

if (text) {
// store it in the editor
useEditorStore.setState({ userPasted: text });
Expand Down

0 comments on commit cf5435b

Please sign in to comment.