@@ -41,19 +41,20 @@ interface Props {
41
41
minimized : boolean ;
42
42
}
43
43
44
- export 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 ;
44
+ export default function ConditionalUserOnboardingButton ( { selected, minimized } : Props ) {
45
+ const useCase = useSettingValue < UseCase | null > ( "FTUE.useCaseSelection" ) ;
46
+ const visible = useSettingValue < boolean > ( "FTUE.userOnboardingButton" ) ;
51
47
52
- let progress = 1 ;
53
- if ( context && waiting ) {
54
- progress = completed / total ;
48
+ if ( ! visible || minimized || ! showUserOnboardingPage ( useCase ) ) {
49
+ return null ;
55
50
}
56
51
52
+ return (
53
+ < UserOnboardingButton selected = { selected } minimized = { minimized } />
54
+ ) ;
55
+ }
56
+
57
+ function UserOnboardingButton ( { selected, minimized } : Props ) {
57
58
const onDismiss = useCallback ( ( ev : ButtonEvent ) => {
58
59
PosthogTrackers . trackInteraction ( "WebRoomListUserOnboardingIgnoreButton" , ev ) ;
59
60
SettingsStore . setValue ( "FTUE.userOnboardingButton" , null , SettingLevel . ACCOUNT , false ) ;
@@ -64,12 +65,6 @@ export function UserOnboardingButton({ selected, minimized }: Props) {
64
65
defaultDispatcher . fire ( Action . ViewHomePage ) ;
65
66
} , [ ] ) ;
66
67
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
-
73
68
return (
74
69
< AccessibleButton
75
70
className = { classNames ( "mx_UserOnboardingButton" , {
0 commit comments