closeErrorsOnDeepLink
Michael Truell 2023-03-29 20:03:48 -07:00
parent 8f5bab8e5a
commit ea14a89b4d
4 changed files with 81 additions and 53 deletions

View File

@ -2,14 +2,19 @@ module.exports = {
packagerConfig: {
name: 'Cursor',
icon: 'assets/icon/icon',
extraResource: ['./lsp', './resources', './tutor', './todesktop-runtime-config.json'],
extraResource: [
'./lsp',
'./resources',
'./tutor',
'./todesktop-runtime-config.json',
],
osxSign: {},
protocols: [
{
name: "Electron Fiddle",
schemes: ["electron-fiddle"]
}
]
{
name: 'Electron Fiddle',
schemes: ['electron-fiddle'],
},
],
},
rebuildConfig: {},
makers: [
@ -30,11 +35,11 @@ module.exports = {
},
},
{
"name": "@electron-forge/maker-deb",
"config": {
"mimeType": ["x-scheme-handler/electron-fiddle"]
}
}
name: '@electron-forge/maker-deb',
config: {
mimeType: ['x-scheme-handler/electron-fiddle'],
},
},
],
plugins: [
{

View File

@ -161,7 +161,7 @@ function runHistoryCommand(cm: CodeMirror, revert: boolean) {
if (cm.curOp) {
cm.curOp.$changeStart = undefined
}
(revert ? undo : redo)(cm.cm6)
;(revert ? undo : redo)(cm.cm6)
const changeStartIndex = cm.curOp?.$changeStart
// vim mode expects the changed text to be either selected or cursor placed at the start
if (changeStartIndex != null) {
@ -568,7 +568,7 @@ export class CodeMirror {
caseSensitive: !/i/.test(query.flags),
})
if (cm6Query.valid) {
(cm6Query as any).forVim = true
;(cm6Query as any).forVim = true
this.cm6Query = cm6Query
const effect = setSearchQuery.of(cm6Query)
this.cm6.dispatch({ effects: effect })
@ -784,7 +784,7 @@ export class CodeMirror {
this.refresh()
}
refresh() {
(this.cm6 as any).measure()
;(this.cm6 as any).measure()
}
// event listeners

View File

@ -4,9 +4,13 @@ import { getError, getShowErrors } from '../features/selectors'
import { faClose } from '@fortawesome/pro-regular-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Modal from 'react-modal'
import { NoAuthGlobalOldRateLimitError, NotLoggedInError, OpenAIError } from '../utils';
import { CursorLogin, OpenAILoginPanel } from './settingsPane';
import { signInCursor, upgradeCursor } from '../features/tools/toolSlice';
import {
NoAuthGlobalOldRateLimitError,
NotLoggedInError,
OpenAIError,
} from '../utils'
import { CursorLogin, OpenAILoginPanel } from './settingsPane'
import { signInCursor, upgradeCursor } from '../features/tools/toolSlice'
const customStyles = {
overlay: {
@ -103,28 +107,39 @@ export function ErrorPopup() {
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">To avoid abuse on our backend, we ask that you login in to use the AI features</div>
<div className="signup__signup_button" onClick={() => dispatch(signInCursor(null))}>Log in</div>
<div className="signup__signup_button" onClick={() => dispatch(signInCursor(null))}>Sign up</div>
</div>
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__body">
<div className="signup__title">Cursor</div>
<div className="signup__module">
<div className="signup__subtitle">
Or enter your OpenAI API key
To avoid abuse on our backend, we ask that you
login in to use the AI features
</div>
<div
className="signup__signup_button"
onClick={() => dispatch(signInCursor(null))}
>
Log in
</div>
<div
className="signup__signup_button"
onClick={() => dispatch(signInCursor(null))}
>
Sign up
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
<div className="signup__signup_button">Log in</div>
<div className="signup__signup_button">Sign up</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</Modal>
@ -148,26 +163,34 @@ export function ErrorPopup() {
<FontAwesomeIcon icon={faClose} />
</div>
</div>
<div className="signup__body">
<div className="signup__title">Free tier limit exceeded</div>
<div className="signup__module">
<div className="signup__subtitle">If you've enjoyed using Cursor, please consider subscribing to one of our paid plans</div>
<div className="signup__signup_button" onClick={() => dispatch(upgradeCursor(null))}>Upgrade</div>
</div>
<div className="signup__signup_button">Upgrade</div>
<div className="signup__body">
<div className="signup__title">
Free tier limit exceeded
</div>
<div className="signup__module signup__last_module">
<div className="signup__module">
<div className="signup__subtitle">
Or enter your OpenAI API key to continue using
the AI features at-cost
If you've enjoyed using Cursor, please consider
subscribing to one of our paid plans
</div>
<div
className="signup__signup_button"
onClick={() => dispatch(upgradeCursor(null))}
>
Upgrade
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
<div className="signup__signup_button">Upgrade</div>
</div>
<div className="signup__module signup__last_module">
<div className="signup__subtitle">
Or enter your OpenAI API key to continue using the
AI features at-cost
</div>
<OpenAILoginPanel
onSubmit={() => {
dispatch(closeError())
}}
/>
</div>
</div>
</Modal>

View File

@ -330,7 +330,7 @@ export function ChatPopup() {
function handleMouseDown() {
if (document.activeElement) {
(document.activeElement as HTMLElement).blur()
;(document.activeElement as HTMLElement).blur()
}
}
return (