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

View File

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

View File

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