@@ -42,18 +42,19 @@ interface Props {
4242}
4343
4444export function UserOnboardingButton ( { selected, minimized } : Props ) {
45- const context = useUserOnboardingContext ( ) ;
46- const [ completedTasks , waitingTasks ] = useUserOnboardingTasks ( context ) ;
47-
48- const completed = completedTasks . length ;
49- const waiting = waitingTasks . length ;
50- const total = completed + waiting ;
45+ const useCase = useSettingValue < UseCase | null > ( "FTUE.useCaseSelection" ) ;
46+ const visible = useSettingValue < boolean > ( "FTUE.userOnboardingButton" ) ;
5147
52- let progress = 1 ;
53- if ( context && waiting ) {
54- progress = completed / total ;
48+ if ( ! visible || minimized || ! showUserOnboardingPage ( useCase ) ) {
49+ return null ;
5550 }
5651
52+ return (
53+ < UserOnboardingButtonInternal selected = { selected } minimized = { minimized } />
54+ ) ;
55+ }
56+
57+ function UserOnboardingButtonInternal ( { selected, minimized } : Props ) {
5758 const onDismiss = useCallback ( ( ev : ButtonEvent ) => {
5859 PosthogTrackers . trackInteraction ( "WebRoomListUserOnboardingIgnoreButton" , ev ) ;
5960 SettingsStore . setValue ( "FTUE.userOnboardingButton" , null , SettingLevel . ACCOUNT , false ) ;
@@ -64,12 +65,6 @@ export function UserOnboardingButton({ selected, minimized }: Props) {
6465 defaultDispatcher . fire ( Action . ViewHomePage ) ;
6566 } , [ ] ) ;
6667
67- const useCase = useSettingValue < UseCase | null > ( "FTUE.useCaseSelection" ) ;
68- const visible = useSettingValue < boolean > ( "FTUE.userOnboardingButton" ) ;
69- if ( ! visible || minimized || ! showUserOnboardingPage ( useCase ) ) {
70- return null ;
71- }
72-
7368 return (
7469 < AccessibleButton
7570 className = { classNames ( "mx_UserOnboardingButton" , {
0 commit comments