Skip to content

Commit

Permalink
fix: Prevent wrong appearance of skeleton after second tab click
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanislav Lunyachek authored and Stanislav Lunyachek committed Oct 21, 2023
1 parent 38c186d commit 517f2df
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/logistration/Logistration.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ const Logistration = (props) => {
setInstitutionLogin(!institutionLogin);
};

const handleOnSelect = (tabKey) => {
const handleOnSelect = (tabKey, selectedPage) => {

Check failure on line 67 in src/logistration/Logistration.jsx

View workflow job for this annotation

GitHub Actions / tests

'selectedPage' is already declared in the upper scope on line 32 column 11
if (tabKey === selectedPage) {
return;
};

Check failure on line 70 in src/logistration/Logistration.jsx

View workflow job for this annotation

GitHub Actions / tests

Unnecessary semicolon
sendTrackEvent(`edx.bi.${tabKey.replace('/', '')}_form.toggled`, { category: 'user-engagement' });
props.clearThirdPartyAuthContextErrorMessage();
if (tabKey === LOGIN_PAGE) {
Expand Down Expand Up @@ -117,7 +120,7 @@ const Logistration = (props) => {
</Tabs>
)
: (!isValidTpaHint() && (
<Tabs defaultActiveKey={selectedPage} id="controlled-tab" onSelect={handleOnSelect}>
<Tabs defaultActiveKey={selectedPage} id="controlled-tab" onSelect={(tabKey) => handleOnSelect(tabKey, selectedPage)}>
<Tab title={formatMessage(messages['logistration.register'])} eventKey={REGISTER_PAGE} />
<Tab title={formatMessage(messages['logistration.sign.in'])} eventKey={LOGIN_PAGE} />
</Tabs>
Expand Down

0 comments on commit 517f2df

Please sign in to comment.