Update welcome page condition (#19308)

* update welcome page condition

* update Welcome page consition

* fix conditions

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
(cherry picked from commit 63090da961c89b5314a8270262aa8d3faf4c7eb9)
This commit is contained in:
Sweta Agarwalla 2025-01-10 15:55:27 +05:30 committed by Chirag Madlani
parent dd4b29c10c
commit 6fd13d940c
3 changed files with 21 additions and 28 deletions

View File

@ -30,7 +30,6 @@ import PermissionProvider from './context/PermissionProvider/PermissionProvider'
import TourProvider from './context/TourProvider/TourProvider'; import TourProvider from './context/TourProvider/TourProvider';
import WebSocketProvider from './context/WebSocketProvider/WebSocketProvider'; import WebSocketProvider from './context/WebSocketProvider/WebSocketProvider';
import { useApplicationStore } from './hooks/useApplicationStore'; import { useApplicationStore } from './hooks/useApplicationStore';
import { useWelcomeStore } from './hooks/useWelcomeStore';
import { getCustomUiThemePreference } from './rest/settingConfigAPI'; import { getCustomUiThemePreference } from './rest/settingConfigAPI';
import { history } from './utils/HistoryUtils'; import { history } from './utils/HistoryUtils';
import i18n from './utils/i18next/LocalUtil'; import i18n from './utils/i18next/LocalUtil';
@ -38,7 +37,6 @@ import { getThemeConfig } from './utils/ThemeUtils';
const App: FC = () => { const App: FC = () => {
const { applicationConfig, setApplicationConfig } = useApplicationStore(); const { applicationConfig, setApplicationConfig } = useApplicationStore();
const { setIsWelcomeVisible } = useWelcomeStore();
const fetchApplicationConfig = async () => { const fetchApplicationConfig = async () => {
try { try {
@ -56,7 +54,6 @@ const App: FC = () => {
useEffect(() => { useEffect(() => {
fetchApplicationConfig(); fetchApplicationConfig();
setIsWelcomeVisible(true);
}, []); }, []);
useEffect(() => { useEffect(() => {

View File

@ -18,7 +18,7 @@ interface WelcomeStore {
} }
export const useWelcomeStore = create<WelcomeStore>()((set) => ({ export const useWelcomeStore = create<WelcomeStore>()((set) => ({
isWelcomeVisible: false, isWelcomeVisible: true,
setIsWelcomeVisible: (isVisible: boolean) => { setIsWelcomeVisible: (isVisible: boolean) => {
set({ isWelcomeVisible: isVisible }); set({ isWelcomeVisible: isVisible });
}, },

View File

@ -115,7 +115,7 @@ const MyDataPage = () => {
updateWelcomeScreen(!usernameExistsInCookie && isWelcomeVisible); updateWelcomeScreen(!usernameExistsInCookie && isWelcomeVisible);
return () => updateWelcomeScreen(false); return () => updateWelcomeScreen(false);
}, []); }, [isWelcomeVisible]);
const fetchUserFollowedData = async () => { const fetchUserFollowedData = async () => {
if (!currentUser?.id) { if (!currentUser?.id) {
@ -196,6 +196,10 @@ const MyDataPage = () => {
// call the hook to set the direction of the grid layout // call the hook to set the direction of the grid layout
useGridLayoutDirection(isLoading); useGridLayoutDirection(isLoading);
if (isLoading || applicationsLoading) {
return <Loader fullScreen />;
}
if (showWelcomeScreen) { if (showWelcomeScreen) {
return ( return (
<div className="bg-white full-height"> <div className="bg-white full-height">
@ -209,12 +213,6 @@ const MyDataPage = () => {
<PageLayoutV1 <PageLayoutV1
mainContainerClassName="p-t-0" mainContainerClassName="p-t-0"
pageTitle={t('label.my-data')}> pageTitle={t('label.my-data')}>
{isLoading || applicationsLoading ? (
<div className="ant-layout-content flex-center">
<Loader />
</div>
) : (
<>
<ReactGridLayout <ReactGridLayout
className="bg-white" className="bg-white"
cols={4} cols={4}
@ -230,8 +228,6 @@ const MyDataPage = () => {
<LimitWrapper resource="dataAssets"> <LimitWrapper resource="dataAssets">
<br /> <br />
</LimitWrapper> </LimitWrapper>
</>
)}
</PageLayoutV1> </PageLayoutV1>
</ActivityFeedProvider> </ActivityFeedProvider>
); );