import { MainWindowState } from '../../../../../models/mainwindow/main-window-state' ; import { NavigationState } from '../../../../../models/mainwindow/navigation/navigation-state' ; import { SocialShareUserInfo } from '../../../../../models/mainwindow/social-share-user-info' ; import { OverwolfService } from '../../../../overwolf.service' ; import { UpdateTwitterSocialInfoEvent } from '../../events/social/update-twitter-social-info-event' ; import { Processor } from '../processor' ; export class UpdateTwitterSocialInfoProcessor implements Processor { constructor ( private ow ) { } public async process ( event , currentState , stateHistory , navigationState ) { const socialShareUserInfo = await this . initializeSocialShareUserInfo ( currentState . socialShareUserInfo ) ; return [ Object . assign ( new MainWindowState ( ) , currentState , { socialShareUserInfo : socialShareUserInfo , } as MainWindowState ) , null , ] ; } private async initializeSocialShareUserInfo ( socialShareUserInfo ) { const twitter = await this . ow . getTwitterUserInfo ( ) ; return Object . assign ( new SocialShareUserInfo ( ) , socialShareUserInfo , { twitter : twitter , } as SocialShareUserInfo ) ; } }