l-min-components 1.0.794 → 1.0.797
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -255,7 +255,7 @@ const AccountDropdown = (props) => {
|
|
|
255
255
|
))}
|
|
256
256
|
|
|
257
257
|
{envType === "staging" ||
|
|
258
|
-
(envType === "localhost" &&
|
|
258
|
+
(envType === "localhost" && !props?.hasDeveloperAccount && // dont show personal accounts for developer user
|
|
259
259
|
props?.personalAccountData?.length > 0 && (
|
|
260
260
|
<div>
|
|
261
261
|
<h3>Personal account</h3>
|
|
@@ -166,7 +166,7 @@ const HeaderComponent = (props) => {
|
|
|
166
166
|
const validAccounts = userAccountsDetail.data.results.filter(
|
|
167
167
|
(account) => !account.pending_delete
|
|
168
168
|
);
|
|
169
|
-
|
|
169
|
+
|
|
170
170
|
if (
|
|
171
171
|
generalData?.selectedAccount &&
|
|
172
172
|
generalData?.selectedAccount?.pending_delete
|
|
@@ -174,13 +174,21 @@ const HeaderComponent = (props) => {
|
|
|
174
174
|
const nextValidAccount = validAccounts[0];
|
|
175
175
|
if (nextValidAccount) {
|
|
176
176
|
setSelectedAccount(nextValidAccount);
|
|
177
|
-
} else {
|
|
178
|
-
// Fallback to personal account or some default setting
|
|
179
|
-
setSelectedAccount(personalAccountData[0]);
|
|
180
177
|
}
|
|
181
178
|
}
|
|
182
179
|
}
|
|
183
180
|
}, [generalData?.selectedAccount, userAccountsDetail?.data]);
|
|
181
|
+
|
|
182
|
+
const [hasDeveloperAccount, setHasDeveloperAccount] = useState(false);
|
|
183
|
+
// New useEffect to check for a DEVELOPER account
|
|
184
|
+
useEffect(() => {
|
|
185
|
+
if (userAccountsDetail?.data) {
|
|
186
|
+
const hasDeveloper = userAccountsDetail.data.results.some(
|
|
187
|
+
(account) => account.type === "DEVELOPER"
|
|
188
|
+
);
|
|
189
|
+
setHasDeveloperAccount(hasDeveloper);
|
|
190
|
+
}
|
|
191
|
+
}, [userAccountsDetail?.data]);
|
|
184
192
|
|
|
185
193
|
const containerRef = useRef(null);
|
|
186
194
|
const secondContainerRef = useRef(null);
|
|
@@ -539,6 +547,7 @@ const HeaderComponent = (props) => {
|
|
|
539
547
|
setDefaultAccount={setDefaultAccount}
|
|
540
548
|
handleSetDefaultAccount={handleSetDefaultAccount}
|
|
541
549
|
ref={acctDropdownContainerRef}
|
|
550
|
+
hasDeveloperAccount={hasDeveloperAccount}
|
|
542
551
|
/>
|
|
543
552
|
)}
|
|
544
553
|
</Navbar>
|