Left menu and chip links (#12294)
Small optimization for faster loading (gaining ~80ms - average time of a click) It might seem a little over-engineered but there are a lot of edge cases and I couldn't find a simpler solution I also tried to tackle Link Chips but it's more complex so this will be for another PR
This commit is contained in:
@ -23,9 +23,15 @@ export const SentryInitEffect = () => {
|
||||
const currentWorkspaceMember = useRecoilValue(currentWorkspaceMemberState);
|
||||
|
||||
const [isSentryInitialized, setIsSentryInitialized] = useState(false);
|
||||
const [isSentryInitializing, setIsSentryInitializing] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isNonEmptyString(sentryConfig?.dsn) && !isSentryInitialized) {
|
||||
if (
|
||||
!isSentryInitializing &&
|
||||
isNonEmptyString(sentryConfig?.dsn) &&
|
||||
!isSentryInitialized
|
||||
) {
|
||||
setIsSentryInitializing(true);
|
||||
init({
|
||||
environment: sentryConfig?.environment ?? undefined,
|
||||
release: sentryConfig?.release ?? undefined,
|
||||
@ -38,6 +44,7 @@ export const SentryInitEffect = () => {
|
||||
});
|
||||
|
||||
setIsSentryInitialized(true);
|
||||
setIsSentryInitializing(false);
|
||||
}
|
||||
|
||||
if (isDefined(currentUser)) {
|
||||
@ -53,6 +60,7 @@ export const SentryInitEffect = () => {
|
||||
}, [
|
||||
sentryConfig,
|
||||
isSentryInitialized,
|
||||
isSentryInitializing,
|
||||
currentUser,
|
||||
currentWorkspace,
|
||||
currentWorkspaceMember,
|
||||
|
||||
Reference in New Issue
Block a user