Skip to content

[v4 beta-13] On cordova resume event, angular/src/util/util.js fails #15944

Closed

Description

@MarkChrisLevy

Bug Report

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

@ionic/angular 4.0.0-beta13

Describe the Bug
When using cordova browser, util/util.js proxyEvent fails when on resume event is fired.

util.js:10 Uncaught TypeError: Cannot read property 'detail' of undefined
    at Channel.<anonymous> (util.js:10)
    at Channel.fire (cordova.js:798)
    at HTMLDocument.<anonymous> (cordova.js:1508)

zrzut ekranu 2018-10-15 o 07 57 07

@manucorporat made changes to util.js, adding support for back button event and it is missing the check if event isn't undefined/null, which for some reasons is the case for on resume. So the fix is very simple:

export function proxyEvent<T>(emitter: EventEmitter<T>, el: EventTarget, eventName: string) {
 el.addEventListener(eventName, (ev) => {
  emitter.emit(ev ? (ev as any).detail as T : undefined);
  });
}	

Steps to Reproduce
Steps to reproduce the behavior:

  1. Load the web app, which uses cordova browser
  2. open another tab
  3. go back to the tab with the web app - the error is thrown

Expected Behavior
No error obviously.

Activity

  1. changed the title [-]On cordova resume event, angular/src/util/util.js fails[/-] [+][v4 beta-13] On cordova resume event, angular/src/util/util.js fails[/+] on Oct 15, 2018
  2. ionitron-bot commented on Nov 22, 2018

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  3. locked and limited conversation to collaborators on Nov 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions