Commit dc33e4be authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Remove 'ready' RPC event

The new built-in "connect" PortRPC event (see #4175) makes the `ready`
RPC event redundant. The host frame now uses the `connect` event to know
when the sidebar frame is connected, and hence display it.
parent f6ca8fad
......@@ -197,7 +197,7 @@ export class Sidebar {
this._notifyOfLayoutChange(false);
this._setupSidebarEvents();
this._sidebarRPC.on('ready', () => {
this._sidebarRPC.on('connect', () => {
// Show the UI
if (this.iframeContainer) {
this.iframeContainer.style.display = '';
......
......@@ -72,7 +72,7 @@ describe('Sidebar', () => {
* when the sidebar has loaded and is ready.
*/
const connectSidebarApp = () => {
emitSidebarEvent('ready');
emitSidebarEvent('connect');
};
/**
......
......@@ -370,7 +370,6 @@ export class FrameSyncService {
// Create channel for sidebar-host communication.
const hostPort = await this._portFinder.discover('host');
this._hostRPC.connect(hostPort);
this._hostRPC.call('ready');
// Listen for guests connecting to the sidebar.
this._listeners.add(hostPort, 'message', event => {
......
......@@ -186,12 +186,6 @@ describe('FrameSyncService', () => {
assert.calledWith(hostRPC().connect, sidebarPort);
});
it('notifies the host frame that the sidebar is ready to be displayed', async () => {
await frameSync.connect();
assert.calledWith(hostRPC().call, 'ready');
});
it('connects to new guests', async () => {
frameSync.connect();
const port = await connectGuest();
......
......@@ -145,11 +145,6 @@ export type SidebarToGuestEvent =
* Events that the sidebar sends to the host
*/
export type SidebarToHostEvent =
/**
* The sidebar notifies the host that it has loaded and is ready to be displayed.
*/
| 'ready'
/**
* The sidebar relays to the host to close the sidebar.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment