Skip to content

Commit

Permalink
fix: Prevent wrong appearance of skeleton after second tab click (#1224)
Browse files Browse the repository at this point in the history
Co-authored-by: Stanislav Lunyachek <[email protected]>
  • Loading branch information
Lunyachek and Stanislav Lunyachek authored Dec 23, 2024
1 parent ab35770 commit 8b21603
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;
}
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 8b21603

Please sign in to comment.