mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-21 15:38:40 +03:00
console: fixes for cloud console
Co-authored-by: Sooraj <8408875+soorajshankar@users.noreply.github.com> GitOrigin-RevId: 7e86572cb18e045520a922e57a22057a82af6f0f
This commit is contained in:
parent
baae5441f2
commit
827a332464
@ -31,16 +31,23 @@ const App = ({
|
||||
document.getElementById('content').className = className + ' show';
|
||||
document.getElementById('loading').style.display = 'none';
|
||||
}, []);
|
||||
const telemetryShown = React.useRef(false);
|
||||
// should be true only in the case of hasura cloud
|
||||
const isContextCloud =
|
||||
window.__env.userRole || window.location.host.includes('cloud');
|
||||
|
||||
React.useEffect(() => {
|
||||
if (
|
||||
telemetry.console_opts &&
|
||||
!telemetry.console_opts.telemetryNotificationShown
|
||||
!telemetry.console_opts.telemetryNotificationShown &&
|
||||
!telemetryShown.current &&
|
||||
!isContextCloud
|
||||
) {
|
||||
telemetryShown.current = true;
|
||||
dispatch(showTelemetryNotification());
|
||||
dispatch(telemetryNotificationShown());
|
||||
}
|
||||
}, [dispatch, telemetry]);
|
||||
}, [dispatch, telemetry, isContextCloud]);
|
||||
|
||||
let connectionFailMsg = null;
|
||||
if (connectionFailed) {
|
||||
|
@ -1,3 +1,4 @@
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
import { AnyAction, Dispatch } from 'redux';
|
||||
import { ThunkDispatch } from 'redux-thunk';
|
||||
|
||||
@ -109,9 +110,14 @@ const setOnboardingCompletedInDB = (
|
||||
getState: GetReduxState
|
||||
) => {
|
||||
const successCb = () => {
|
||||
dispatch(
|
||||
showSuccessNotification('Success', 'Dismissed console onboarding')
|
||||
);
|
||||
// the success notification won't be shown on cloud
|
||||
const isCloudContext =
|
||||
window.__env.userRole || window.location.host.includes('cloud');
|
||||
if (!isCloudContext) {
|
||||
dispatch(
|
||||
showSuccessNotification('Success', 'Dismissed console onboarding')
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
const errorCb = (error: Error) => {
|
||||
|
Loading…
Reference in New Issue
Block a user