mirror of
https://github.com/cline/cline.git
synced 2026-09-16 21:01:52 +08:00
Remove email subscribe
This commit is contained in:
@@ -806,9 +806,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
case "getLatestState":
|
||||
await this.postStateToWebview()
|
||||
break
|
||||
case "subscribeEmail":
|
||||
this.subscribeEmail(message.text)
|
||||
break
|
||||
case "accountLoginClicked": {
|
||||
// Generate nonce for state validation
|
||||
const nonce = crypto.randomBytes(32).toString("hex")
|
||||
@@ -1108,35 +1105,6 @@ export class ClineProvider implements vscode.WebviewViewProvider {
|
||||
}
|
||||
}
|
||||
}
|
||||
async subscribeEmail(email?: string) {
|
||||
if (!email) {
|
||||
return
|
||||
}
|
||||
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
||||
if (!emailRegex.test(email)) {
|
||||
vscode.window.showErrorMessage("Please enter a valid email address")
|
||||
return
|
||||
}
|
||||
console.log("Subscribing email:", email)
|
||||
this.postMessageToWebview({ type: "emailSubscribed" })
|
||||
// Currently ignoring errors to this endpoint, but after accounts we'll remove this anyways
|
||||
try {
|
||||
const response = await axios.post(
|
||||
"https://app.cline.bot/api/mailing-list",
|
||||
{
|
||||
email: email,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
},
|
||||
)
|
||||
console.log("Email subscribed successfully. Response:", response.data)
|
||||
} catch (error) {
|
||||
console.error("Failed to subscribe email:", error)
|
||||
}
|
||||
}
|
||||
|
||||
async cancelTask() {
|
||||
if (this.cline) {
|
||||
|
||||
@@ -27,7 +27,6 @@ export interface ExtensionMessage {
|
||||
| "relinquishControl"
|
||||
| "vsCodeLmModels"
|
||||
| "requestVsCodeLmModels"
|
||||
| "emailSubscribed"
|
||||
| "authCallback"
|
||||
| "mcpMarketplaceCatalog"
|
||||
| "mcpDownloadDetails"
|
||||
|
||||
@@ -45,7 +45,6 @@ export interface WebviewMessage {
|
||||
| "getLatestState"
|
||||
| "accountLoginClicked"
|
||||
| "accountLogoutClicked"
|
||||
| "subscribeEmail"
|
||||
| "authStateChanged"
|
||||
| "authCallback"
|
||||
| "fetchMcpMarketplace"
|
||||
|
||||
Reference in New Issue
Block a user