forked from getcursor/cursor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add in reserved capacity pro plan for users who want it
- Loading branch information
Showing
18 changed files
with
997 additions
and
36 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,74 @@ function ErrorPopup() { | |
) | ||
} | ||
|
||
function RateLimitPopup() { | ||
const showError = useAppSelector(gsel.getShowRateLimit) | ||
const dispatch = useAppDispatch() | ||
|
||
return ( | ||
<Modal | ||
isOpen={showError} | ||
onRequestClose={() => { | ||
dispatch(gs.closeRateLimit()) | ||
}} | ||
style={customStyles} | ||
> | ||
<div className="errorPopup"> | ||
<div className="errorPopup__title"> | ||
<div className="errorPopup__title_text"> | ||
You're going a bit fast... | ||
</div> | ||
<div | ||
className="errorPopup__title_close" | ||
onClick={() => dispatch(gs.closeError(null))} | ||
> | ||
<FontAwesomeIcon icon={faClose} /> | ||
</div> | ||
</div> | ||
<div className="errorPopup__body"> | ||
It seems like you're making a high rate of requests. Please slow down and try again in a minute or so. If you believe this is an error, contact us at [email protected] | ||
<br /> | ||
</div> | ||
</div> | ||
</Modal> | ||
) | ||
} | ||
|
||
function NoAuthRateLimitPopup() { | ||
const showError = useAppSelector(gsel.getShowNoAuthRateLimit) | ||
const dispatch = useAppDispatch() | ||
|
||
return ( | ||
<Modal | ||
isOpen={showError} | ||
onRequestClose={() => { | ||
dispatch(gs.closeNoAuthRateLimit()) | ||
}} | ||
style={customStyles} | ||
> | ||
<div className="errorPopup"> | ||
<div className="errorPopup__title"> | ||
<div className="errorPopup__title_text"> | ||
Maximum Capacity | ||
</div> | ||
<div | ||
className="errorPopup__title_close" | ||
onClick={() => dispatch(gs.closeNoAuthRateLimit())} | ||
> | ||
<FontAwesomeIcon icon={faClose} /> | ||
</div> | ||
</div> | ||
<div className="errorPopup__body"> | ||
We're getting more traffic than our servers can handle right now. To avoid these limits and to purchase reserved capacity, you can upgrade to <a | ||
className="pay-link" | ||
onClick={() => dispatch(ts.upgradeCursor(null))} | ||
>Cursor Pro</a> for $20/month. | ||
</div> | ||
</div> | ||
</Modal> | ||
) | ||
} | ||
|
||
function SSHPopup() { | ||
const showRemotePopup = useAppSelector(gsel.getShowRemotePopup) | ||
const remoteCommand = useAppSelector(gsel.getRemoteCommand) | ||
|
@@ -169,8 +237,8 @@ function SSHPopup() { | |
onKeyDown={(event: any) => { | ||
if (event.key === 'Enter') { | ||
submit() | ||
} | ||
}} | ||
}} | ||
} | ||
/> | ||
</div> | ||
<div className="submit-button-parent"> | ||
|
@@ -248,6 +316,9 @@ export function App() { | |
} else if (e.key == 'e' && e.shiftKey) { | ||
dispatch(ct.pressAICommand('singleLSP')) | ||
e.stopPropagation() | ||
} else if (e.key == 'h') { | ||
dispatch(ct.pressAICommand('history')) | ||
e.stopPropagation() | ||
} | ||
} | ||
|
||
|
@@ -361,6 +432,8 @@ export function App() { | |
</div> | ||
<ChatPopup /> | ||
<ErrorPopup /> | ||
<RateLimitPopup /> | ||
<NoAuthRateLimitPopup /> | ||
<SettingsPopup /> | ||
<FeedbackArea /> | ||
<SSHPopup /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.