From b48d37c022ac2dbbeefa7c386d8221649614e872 Mon Sep 17 00:00:00 2001 From: David Tuite Date: Sun, 21 Jun 2020 20:10:53 +0100 Subject: [PATCH] Fix CircleCI plugin (#1384) * Fix disappearing CircleCI plugin The paths for the CircleCI plugin were too deeply nested causing a blank page to render when one visited /circleci. * Set correct inputs from CircleCI settings Typically, a value like `tokenFromStore` would be an empty string. The code was setting `tokenFromStore` (rather than `token`) into the state on every keystroke. I don't know what potential effect this change has on storing tokens because I haven't tested that feature yet. Hopefully it still works as intended. * Add Vim .swp files to .gitignore Co-authored-by: David Tuite --- .gitignore | 3 +++ plugins/circleci/src/components/App.tsx | 7 ++----- plugins/circleci/src/components/Settings/Settings.tsx | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index f5794babbc..a1eb87e8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -116,3 +116,6 @@ dist # Stores VSCode versions used for testing VSCode extensions .vscode-test + +# Temporary change files created by Vim +*.swp diff --git a/plugins/circleci/src/components/App.tsx b/plugins/circleci/src/components/App.tsx index 5907146340..a3f7112132 100644 --- a/plugins/circleci/src/components/App.tsx +++ b/plugins/circleci/src/components/App.tsx @@ -25,11 +25,8 @@ export const App = () => { <> - } /> - } - /> + } /> + } /> diff --git a/plugins/circleci/src/components/Settings/Settings.tsx b/plugins/circleci/src/components/Settings/Settings.tsx index 8897c1eb40..b3b62ce930 100644 --- a/plugins/circleci/src/components/Settings/Settings.tsx +++ b/plugins/circleci/src/components/Settings/Settings.tsx @@ -44,13 +44,13 @@ const Settings = () => { useEffect(() => { if (tokenFromStore !== token) { - setToken(tokenFromStore); + setToken(token); } if (ownerFromStore !== owner) { - setOwner(ownerFromStore); + setOwner(owner); } if (repoFromStore !== repo) { - setRepo(repoFromStore); + setRepo(repo); } }, [ownerFromStore, repoFromStore, tokenFromStore, token, owner, repo]);