Skip to content

Commit

Permalink
remove onboarding v2 code (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelouis-c committed Sep 7, 2022
1 parent 68c2c0c commit d9800ac
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 270 deletions.
5 changes: 5 additions & 0 deletions .changeset/fresh-pants-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Remove onboarding v2 code
8 changes: 0 additions & 8 deletions apps/ledger-live-desktop/src/renderer/actions/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,10 @@ export const setDismissedCarousel = createAction("APPLICATION_SET_DATA", dismiss
dismissedCarousel,
}));
export const setOSDarkMode = createAction("APPLICATION_SET_DATA", osDarkMode => ({ osDarkMode }));
export const setNotSeededDeviceRelaunch = createAction(
"APPLICATION_SET_DATA",
notSeededDeviceRelaunch => ({ notSeededDeviceRelaunch }),
);
export const setNavigationLock = createAction("APPLICATION_SET_DATA", navigationLocked => ({
navigationLocked,
}));
export const toggleSkeletonVisibility = createAction(
"APPLICATION_SET_DATA",
alwaysShowSkeletons => ({ debug: { alwaysShowSkeletons } }),
);

export const relaunchOnboarding = createAction("RELAUNCH_ONBOARDING", onboardingRelaunched => ({
onboardingRelaunched,
}));
10 changes: 0 additions & 10 deletions apps/ledger-live-desktop/src/renderer/actions/onboarding.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
getAccountCurrency,
} from "@ledgerhq/live-common/account/index";
import { closeAllModal } from "~/renderer/actions/modals";
import { setNotSeededDeviceRelaunch } from "~/renderer/actions/application";
import Animation from "~/renderer/animations";
import Button from "~/renderer/components/Button";
import TranslatedError from "~/renderer/components/TranslatedError";
Expand Down Expand Up @@ -49,7 +48,6 @@ import CryptoCurrencyIcon from "~/renderer/components/CryptoCurrencyIcon";
import { SWAP_VERSION } from "~/renderer/screens/exchange/Swap2/utils/index";
import { context } from "~/renderer/drawers/Provider";
import { track } from "~/renderer/analytics/segment";
import { relaunchOnboarding } from "~/renderer/actions/onboarding";
import { DrawerFooter } from "~/renderer/screens/exchange/Swap2/Form/DrawerFooter";

export const AnimationWrapper: ThemedComponent<{ modelId?: DeviceModelId }> = styled.div`
Expand Down Expand Up @@ -251,8 +249,6 @@ const OpenOnboardingBtn = () => {

const onClick = useCallback(() => {
setTrackingSource("device action open onboarding button");
dispatch(setNotSeededDeviceRelaunch(true));
dispatch(relaunchOnboarding(true));
dispatch(closeAllModal());
setDrawer(undefined);
history.push("/onboarding");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { mockedEventEmitter } from "~/renderer/components/debug/DebugMock";
import { command } from "~/renderer/commands";
import { useDispatch } from "react-redux";
import { saveSettings } from "~/renderer/actions/settings";
import { relaunchOnboarding } from "~/renderer/actions/onboarding";
import { track } from "~/renderer/analytics/segment";
import { OnboardingContext } from "../../../index";

Expand Down Expand Up @@ -46,7 +45,6 @@ export function GenuineCheck({ connectedDevice, setConnectedDevice }: Props) {
res => {
setConnectedDevice(res.device);
dispatch(saveSettings({ hasCompletedOnboarding: true }));
dispatch(relaunchOnboarding(false));
track("Onboarding - End");
},
[setConnectedDevice, dispatch],
Expand Down

This file was deleted.

19 changes: 0 additions & 19 deletions apps/ledger-live-desktop/src/renderer/reducers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ export type ApplicationState = {
osDarkMode?: boolean,
osLanguage?: LangAndRegion,
navigationLocked?: boolean,
notSeededDeviceRelaunch?: boolean,
debug: {
alwaysShowSkeletons: boolean,
},
onboardingRelaunched: boolean,
};

const { language, region } = getParsedSystemLocale();
Expand All @@ -32,27 +30,16 @@ const state: ApplicationState = {
},
hasPassword: false,
dismissedCarousel: false,
notSeededDeviceRelaunch: false,
debug: {
alwaysShowSkeletons: false,
},
onboardingRelaunched: false,
};

const handlers = {
APPLICATION_SET_DATA: (state, { payload }: { payload: ApplicationState }) => ({
...state,
...payload,
}),
RELAUNCH_ONBOARDING: (
state: ApplicationState,
{ payload: onboardingRelaunched }: { payload: boolean },
) => {
return {
...state,
onboardingRelaunched,
};
},
};

// NOTE: V2 `lock` and `unlock` have been moved to actions/application.js
Expand All @@ -77,12 +64,6 @@ export const alwaysShowSkeletonsSelector = (state: { application: ApplicationSta
export const osLangAndRegionSelector = (state: { application: ApplicationState }) =>
state.application.osLanguage;

export const notSeededDeviceRelaunchSelector = (state: { application: ApplicationState }) =>
state.application.notSeededDeviceRelaunch;

export const onboardingRelaunchedSelector = (state: { application: ApplicationState }) =>
state.application.onboardingRelaunched;

export const isNavigationLocked = (state: { application: ApplicationState }) =>
state.application.navigationLocked;

Expand Down
4 changes: 0 additions & 4 deletions apps/ledger-live-desktop/src/renderer/reducers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import devices from "./devices";
import modals from "./modals";
import UI from "./UI";
import settings from "./settings";
import onboarding from "./onboarding";
import swap from "./swap";
import type { AccountsState } from "./accounts";
import type { ApplicationState } from "./application";
import type { DevicesState } from "./devices";
import type { ModalsState } from "./modals";
import type { SettingsState } from "./settings";
import type { OnboardingState } from "./onboarding";
import type { UIState } from "./UI";
import type { SwapStateType } from "./swap";

Expand All @@ -23,7 +21,6 @@ export type State = {
devices: DevicesState,
modals: ModalsState,
settings: SettingsState,
onboarding: OnboardingState,
UI: UIState,
swap: SwapStateType,
};
Expand All @@ -35,7 +32,6 @@ export default combineReducers({
devices,
modals,
settings,
onboarding,
UI,
swap,
});
178 changes: 0 additions & 178 deletions apps/ledger-live-desktop/src/renderer/reducers/onboarding.js

This file was deleted.

Loading

0 comments on commit d9800ac

Please sign in to comment.