diff --git a/src/chrome/RatingButton.tsx b/src/chrome/RatingButton.tsx index a6942c918..c6dc88c70 100644 --- a/src/chrome/RatingButton.tsx +++ b/src/chrome/RatingButton.tsx @@ -28,10 +28,6 @@ type PropsFromState = { sessionId: string | null; }; -type OwnProps = { - onRatingChanged: (rating: number) => void; -}; - type State = { promptData: FeedbackPrompt | null; isShown: boolean; @@ -287,14 +283,14 @@ class FeedbackComponent extends Component< } } -class RatingButton extends Component { +class RatingButton extends Component { state: State = { promptData: null, isShown: false, hasTriggered: false, }; - constructor(props: PropsFromState & OwnProps) { + constructor(props: PropsFromState) { super(props); if (GK.get('flipper_rating')) { UserFeedback.getPrompt().then(prompt => { @@ -378,6 +374,6 @@ class RatingButton extends Component { } } -export default connect<{sessionId: string | null}, null, OwnProps, Store>( +export default connect<{sessionId: string | null}, null, {}, Store>( ({application: {sessionId}}) => ({sessionId}), )(RatingButton); diff --git a/src/chrome/TitleBar.tsx b/src/chrome/TitleBar.tsx index 25a7a96d7..a61a1d3aa 100644 --- a/src/chrome/TitleBar.tsx +++ b/src/chrome/TitleBar.tsx @@ -15,7 +15,6 @@ import { toggleLeftSidebarVisible, toggleRightSidebarVisible, ACTIVE_SHEET_BUG_REPORTER, - setFlipperRating, ACTIVE_SHEET_SETTINGS, } from '../reducers/application'; import { @@ -69,7 +68,6 @@ type DispatchFromProps = { toggleLeftSidebarVisible: (visible?: boolean) => void; toggleRightSidebarVisible: (visible?: boolean) => void; setActiveSheet: (sheet: ActiveSheet) => void; - setFlipperRating: (rating: number) => void; }; type StateFromProps = { @@ -79,7 +77,6 @@ type StateFromProps = { rightSidebarAvailable: boolean; downloadingImportData: boolean; launcherMsg: LauncherMsg; - flipperRating: number | null; share: ShareType | null | undefined; navPluginIsActive: boolean; }; @@ -161,9 +158,7 @@ class TitleBar extends React.Component { share != null ? share.statusComponent : undefined, )} - {config.showFlipperRating ? ( - - ) : null} + {config.showFlipperRating ? : null} {this.props.version + (isProduction() ? '' : '-dev')} {isAutoUpdaterEnabled() ? ( @@ -221,7 +216,6 @@ export default connect( rightSidebarAvailable, downloadingImportData, launcherMsg, - flipperRating, share, }, pluginStates, @@ -232,7 +226,6 @@ export default connect( rightSidebarAvailable, downloadingImportData, launcherMsg, - flipperRating, share, navPluginIsActive: Object.keys(pluginStates).some(key => /#Navigation$/.test(key), @@ -242,6 +235,5 @@ export default connect( setActiveSheet, toggleLeftSidebarVisible, toggleRightSidebarVisible, - setFlipperRating, }, )(TitleBar); diff --git a/src/dispatcher/tracking.tsx b/src/dispatcher/tracking.tsx index 98802bbfb..7e5f09a0d 100644 --- a/src/dispatcher/tracking.tsx +++ b/src/dispatcher/tracking.tsx @@ -48,8 +48,6 @@ export default (store: Store, logger: Logger) => { clients, } = store.getState().connections; - const {flipperRating} = store.getState().application; - if (!selectedDevice || !selectedPlugin) { return; } @@ -73,7 +71,6 @@ export default (store: Store, logger: Logger) => { plugin: selectedPlugin, app, sdkVersion, - flipperRating, }; // reset dropped frames counter diff --git a/src/reducers/application.tsx b/src/reducers/application.tsx index 3d49d0bfa..264e6b729 100644 --- a/src/reducers/application.tsx +++ b/src/reducers/application.tsx @@ -77,7 +77,6 @@ export type State = { serverPorts: ServerPorts; downloadingImportData: boolean; launcherMsg: LauncherMsg; - flipperRating: number | null; statusMessages: Array; xcodeCommandLineToolsDetected: boolean; }; @@ -120,12 +119,6 @@ export type Action = message: string; }; } - | { - type: 'SET_FLIPPER_RATING'; - payload: { - rating: number; - }; - } | { type: 'UNSET_SHARE'; } @@ -169,7 +162,6 @@ export const initialState: () => State = () => ({ severity: 'warning', message: '', }, - flipperRating: null, statusMessages: [], xcodeCommandLineToolsDetected: false, }); @@ -242,11 +234,6 @@ export default function reducer( ...state, launcherMsg: action.payload, }; - } else if (action.type === 'SET_FLIPPER_RATING') { - return { - ...state, - flipperRating: action.payload.rating, - }; } else if (action.type === 'SET_EXPORT_STATUS_MESSAGE') { if (state.share) { const {share} = state; @@ -344,13 +331,6 @@ export const toggleRightSidebarAvailable = (payload?: boolean): Action => ({ payload, }); -export const setFlipperRating = (rating: number): Action => ({ - type: 'SET_FLIPPER_RATING', - payload: { - rating, - }, -}); - export const setExportURL = (result: string): Action => ({ type: 'SET_EXPORT_URL', payload: result, diff --git a/src/reducers/index.tsx b/src/reducers/index.tsx index 9ed622f12..aed229de9 100644 --- a/src/reducers/index.tsx +++ b/src/reducers/index.tsx @@ -59,7 +59,7 @@ export type Actions = | {type: 'INIT'}; export type State = { - application: ApplicationState & PersistPartial; + application: ApplicationState; connections: DevicesState & PersistPartial; pluginStates: PluginStatesState; notifications: NotificationsState & PersistPartial; @@ -81,14 +81,7 @@ const settingsStorage = new JsonFileStorage( ); export default combineReducers({ - application: persistReducer( - { - key: 'application', - storage, - whitelist: ['flipperRating'], - }, - application, - ), + application, connections: persistReducer( { key: 'connections',