File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ export class FrameSyncService {
129129 if ( frames . length > 0 ) {
130130 if ( frames . every ( frame => frame . isAnnotationFetchComplete ) ) {
131131 if ( publicAnns === 0 || publicAnns !== prevPublicAnns ) {
132- this . _hostRPC . call (
132+ this . notifyHost (
133133 sidebarToHostEvents . PUBLIC_ANNOTATION_COUNT_CHANGED ,
134134 publicAnns
135135 ) ;
@@ -156,7 +156,7 @@ export class FrameSyncService {
156156 // and delete the (unsaved) annotation so it gets un-selected in the
157157 // target document
158158 if ( ! store . isLoggedIn ( ) ) {
159- this . _hostRPC . call ( sidebarToHostEvents . OPEN_SIDEBAR ) ;
159+ this . notifyHost ( sidebarToHostEvents . OPEN_SIDEBAR ) ;
160160 store . openSidebarPanel ( 'loginPrompt' ) ;
161161 this . _guestRPC . call (
162162 sidebarToGuestEvents . DELETE_ANNOTATION ,
@@ -212,11 +212,11 @@ export class FrameSyncService {
212212 ) ;
213213
214214 this . _guestRPC . on ( guestToSidebarEvents . OPEN_SIDEBAR , ( ) => {
215- this . _hostRPC . call ( sidebarToHostEvents . OPEN_SIDEBAR ) ;
215+ this . notifyHost ( sidebarToHostEvents . OPEN_SIDEBAR ) ;
216216 } ) ;
217217
218218 this . _guestRPC . on ( guestToSidebarEvents . CLOSE_SIDEBAR , ( ) => {
219- this . _hostRPC . call ( sidebarToHostEvents . CLOSE_SIDEBAR ) ;
219+ this . notifyHost ( sidebarToHostEvents . CLOSE_SIDEBAR ) ;
220220 } ) ;
221221 } ;
222222 }
Original file line number Diff line number Diff line change @@ -604,8 +604,12 @@ describe('FrameSyncService', () => {
604604 describe ( '#notifyHost' , ( ) => {
605605 it ( 'sends a message to the host frame' , ( ) => {
606606 frameSync . connect ( ) ;
607- frameSync . notifyHost ( 'openNotebook' , 'group-id' ) ;
608- assert . calledWith ( hostBridge ( ) . call , 'openNotebook' , 'group-id' ) ;
607+ frameSync . notifyHost ( sidebarToHostEvents . OPEN_NOTEBOOK , 'group-id' ) ;
608+ assert . calledWith (
609+ hostBridge ( ) . call ,
610+ sidebarToHostEvents . OPEN_NOTEBOOK ,
611+ 'group-id'
612+ ) ;
609613 } ) ;
610614 } ) ;
611615} ) ;
You can’t perform that action at this time.
0 commit comments