Skip to content

Commit 8ddce3c

Browse files
pwstegmanandrewjaykeller
authored andcommitted
Display email address code sent to
1 parent 10998b0 commit 8ddce3c

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/login.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ let deviceid_placeholder = "device ID";
4646
*/
4747
export function registerLoginCommand(command: string) {
4848
vscode.commands.registerCommand(command, () => {
49-
vscode.window
50-
.showQuickPick(loginMethods)
51-
.then(handleLogin, loginError);
49+
vscode.window.showQuickPick(loginMethods).then(handleLogin, loginError);
5250
});
5351
}
5452

@@ -121,11 +119,7 @@ export function loginFromSavedState(saved_state: any) {
121119
* @example
122120
* getOrPrompt('email', 'Please enter your email', '[email protected]')
123121
*/
124-
function getOrPrompt(
125-
section: string,
126-
prompt: string,
127-
placeHolder?: string
128-
) {
122+
function getOrPrompt(section: string, prompt: string, placeHolder?: string) {
129123
return new Promise<string | undefined>((resolve, reject) => {
130124
let config = vscode.workspace.getConfiguration("notion");
131125
let value: string = config.get(section) || "";
@@ -211,8 +205,7 @@ function handleLogin(method: vscode.QuickPickItem | undefined) {
211205
function loginError(error?: string) {
212206
let message = "Error while selecting login method";
213207

214-
if (typeof error === "undefined")
215-
vscode.window.showErrorMessage(message);
208+
if (typeof error === "undefined") vscode.window.showErrorMessage(message);
216209
else vscode.window.showErrorMessage(message + ": " + error);
217210
}
218211

@@ -239,9 +232,7 @@ function sendLoginEmail() {
239232
handleCodeInApp: true
240233
})
241234
.then(loginWithEmailCred)
242-
.catch(() =>
243-
vscode.window.showErrorMessage("Error sending login email")
244-
);
235+
.catch(() => vscode.window.showErrorMessage("Error sending login email"));
245236
}
246237

247238
function loginWithEmailCred() {
@@ -251,8 +242,7 @@ function loginWithEmailCred() {
251242

252243
vscode.window
253244
.showInputBox({
254-
prompt:
255-
"Please enter the code obtained via the link in the email we sent you",
245+
prompt: `Email sent to ${email}. Please enter the code obtained via the link in the email we sent you`,
256246
ignoreFocusOut: true,
257247
placeHolder: "code"
258248
})

0 commit comments

Comments
 (0)