diff --git a/src/export_command/wikimedia_function/bot.ts b/src/export_command/wikimedia_function/bot.ts index db06ca1..66a4d30 100644 --- a/src/export_command/wikimedia_function/bot.ts +++ b/src/export_command/wikimedia_function/bot.ts @@ -100,7 +100,8 @@ export async function getDefaultBot(): Promise { export async function getLoggedInBot(): Promise { const config: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration("wikitext"); - if (bot === undefined) { + // if bot is not be created or not logged in + if (bot === undefined || !bot.loggedIn) { switch (config.get('autoLogin')) { case 'Always': return await login() ? bot : undefined;