Skip to content

Commit

Permalink
Hide OAI key option until we can port over to GA model
Browse files Browse the repository at this point in the history
  • Loading branch information
truell20 committed Mar 28, 2023
1 parent 9e04a00 commit 28e4b81
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 29 deletions.
12 changes: 7 additions & 5 deletions src/appComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const customStyles = {
height: 'auto',
marginLeft: 'auto',
marginRight: 'auto',
maxWidth: '600px',
maxWidth: '700px',
},
}

Expand All @@ -73,7 +73,7 @@ function ErrorPopup() {
<div className="errorPopup">
<div className="errorPopup__title">
<div className="errorPopup__title_text">
Maximum Capacity
We ran into a problem
</div>
<div
className="errorPopup__title_close"
Expand All @@ -83,8 +83,7 @@ function ErrorPopup() {
</div>
</div>
<div className="errorPopup__body">
We're getting more traffic than we can handle right now.
Please try again later.
Something unexpected happened. Please try again later. If this continues, please contact [email protected].
<br />
</div>
</div>
Expand Down Expand Up @@ -153,7 +152,10 @@ function NoAuthRateLimitPopup() {
</div>
<div className="errorPopup__body">
We're getting more traffic than we can handle right
now. To avoid these limits, you can enter your OpenAI API key in Settings.
now. Please try again in one minute. To avoid these limits, you can optionally upgrade to <a
className="pay-link"
onClick={() => dispatch(ts.upgradeCursor(null))}
>pro</a>.
</div>
</div>
</Modal>
Expand Down
25 changes: 2 additions & 23 deletions src/components/settingsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,27 +162,7 @@ export function SettingsPopup() {
/>
</div>

<div className="settings__item">
<div className="settings__item_title">
OpenAI API Key
</div>
<div className="settings__item_description">
We'll use your key for any requests to OpenAI. This will help you avoid "maximum capacity" limits.
</div>
<input
className="settings__item_textarea"
placeholder="Enter your OpenAI API Key"
type="password"
onChange={(e) => {
dispatch(
changeSettings({
openAIKey: e.target.value,
})
)
}}
value={settings.openAIKey || ""}
/>
</div>
<CursorLogin />

<CopilotPanel />
{/* REMOVED CODEBASE-WIDE FEATURES!
Expand All @@ -193,7 +173,6 @@ export function SettingsPopup() {
languageName={name}
/>
))}
<CursorLogin />
</div>
</div>
<div className="cover-bar"></div>
Expand Down Expand Up @@ -248,7 +227,7 @@ function CursorLogin() {
<div className="settings__item">
<div className="settings__item_title">Cursor Pro</div>
<div className="settings__item_description">
If you'd like to pay for unlimited requests, instead of using your OpenAI API key.
Optionally reserve capacity to avoid "maximum capacity" limits.
</div>
{currentPanel}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat/chatThunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ export async function getPayload({
customCodeBlocks,
codeBlockIdentifiers,
msgType: chatState.msgType,
apiKey: oaiKey,
// Messy, but needed for the single lsp stuff to work
maxOrigLine: forContinue
? getLastBotMessage(chatState, conversationId)!.maxOrigLine
Expand Down Expand Up @@ -330,6 +329,7 @@ export async function getPayload({
contextType: state.settingsState.settings.contextType,

rootPath: state.global.rootPath,
apiKey: oaiKey,
}

// document.cookie = `repo_path=${state.global.rootPath}`
Expand Down

0 comments on commit 28e4b81

Please sign in to comment.