console: fix telemetry notification reappearing

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/7781
GitOrigin-RevId: 33c7873f8f9ff950cb7d45adf7b26b352f7fe1ae
This commit is contained in:
Nicolas Inchauspe 2023-02-06 10:29:02 +01:00 committed by hasura-bot
parent c27dceb1df
commit 825e5206b4
2 changed files with 5 additions and 9 deletions

View File

@ -6,7 +6,10 @@ import { hot } from 'react-hot-loader';
import { ThemeProvider } from 'styled-components';
import 'react-loading-skeleton/dist/skeleton.css';
import ErrorBoundary from '../Error/ErrorBoundary';
import { telemetryNotificationShown } from '../../telemetry/Actions';
import {
telemetryNotificationShown,
setTelemetryNotificationShownInDB,
} from '../../telemetry/Actions';
import { showTelemetryNotification } from '../../telemetry/Notifications';
import globals from '../../Globals';
import styles from './App.module.scss';
@ -57,6 +60,7 @@ const App = ({
telemetryShown.current = true;
dispatch(showTelemetryNotification());
dispatch(telemetryNotificationShown());
dispatch(setTelemetryNotificationShownInDB());
}
}, [dispatch, telemetry, isContextCloud]);

View File

@ -2,15 +2,8 @@ import React from 'react';
import { AnyAction } from 'redux';
import { ThunkDispatch } from 'redux-thunk';
import { showNotification } from '../components/Services/Common/Notification';
import { setTelemetryNotificationShownInDB } from './Actions';
import { ReduxState } from '../types';
const onRemove = () => {
return (dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>) => {
dispatch(setTelemetryNotificationShownInDB());
};
};
const showTelemetryNotification = () => {
return (dispatch: ThunkDispatch<ReduxState, unknown, AnyAction>) => {
dispatch(
@ -35,7 +28,6 @@ const showTelemetryNotification = () => {
to read more or to opt-out.
</div>
),
onRemove: () => dispatch(onRemove()),
},
'info'
)