Skip to content

Commit

Permalink
fix: should not override windowName
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Kimball authored and Brian Kimball committed Feb 12, 2018
1 parent a773dfd commit fa1adf8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/AppBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ export class AppBridge {
this._trace(MESSAGE_TYPES.REGISTER, event);
this._registeredFrames.push(event);
return this.register(event.data).then(windowName => {
this.windowName = windowName;
return { windowName };
});
});
Expand Down Expand Up @@ -474,8 +473,8 @@ export class AppBridge {
* @param packet any - packet of data to send with the event
*/
public register(packet: Partial<{ title: string, url: string, color: string }> = {}): Promise<string> {
Object.assign(packet, { id: this.id });
return new Promise<string>((resolve, reject) => {
Object.assign(packet, { id: this.id, windowName: this.windowName || window.name });
if (this._handlers[AppBridgeHandler.REGISTER]) {
this._handlers[AppBridgeHandler.REGISTER](packet, (windowName: string) => {
if (windowName) {
Expand Down

0 comments on commit fa1adf8

Please sign in to comment.