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 27, 2023
1 parent 38c186d commit 4c7ed60
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, currentTab) => {
if (tabKey === currentTab) {
return;

Check warning on line 69 in src/logistration/Logistration.jsx

View check run for this annotation

Codecov / codecov/patch

src/logistration/Logistration.jsx#L69

Added line #L69 was not covered by tests
}
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 4c7ed60

Please sign in to comment.