import { CurrentAppType } from '../../../../../models/mainwindow/current-app.type' ; import { MainWindowState } from '../../../../../models/mainwindow/main-window-state' ; import { NavigationState } from '../../../../../models/mainwindow/navigation/navigation-state' ; import { PreferencesService } from '../../../../preferences.service' ; import { NextFtueEvent } from '../../events/ftue/next-ftue-event' ; import { Processor } from '../processor' ; export class NextFtueProcessor implements Processor { constructor ( private readonly prefs ) { } public async process ( event , currentState , stateHistory , navigationState ) { let nextStep = undefined ; let showFtue = currentState . showFtue ; switch ( navigationState . currentApp ) { case undefined : nextStep = 'decktracker' ; break ; case 'decktracker' : nextStep = 'battlegrounds' ; break ; case 'battlegrounds' : nextStep = 'duels' ; break ; case 'duels' : nextStep = 'arena' ; break ; case 'arena' : nextStep = 'replays' ; break ; case 'replays' : nextStep = 'achievements' ; break ; case 'achievements' : nextStep = 'collection' ; break ; case 'collection' : nextStep = 'decktracker' ; break ; } if ( navigationState . currentApp === 'collection' ) { await this . prefs . setGlobalFtueDone ( ) ; showFtue = false ; } return [ Object . assign ( new MainWindowState ( ) , currentState , { showFtue : showFtue , } as MainWindowState ) , navigationState . update ( { currentApp : nextStep , } as NavigationState ) , ] ; } }