Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Error when force show on desktop #260

Open
gimox opened this issue Jun 23, 2017 · 1 comment
Open

Error when force show on desktop #260

gimox opened this issue Jun 23, 2017 · 1 comment

Comments

@gimox
Copy link

gimox commented Jun 23, 2017

forcing to show on desktop environment show error:

configuration

const addToHome = addToHomescreen({
      maxDisplayCount: 3,
      autostart: false,
      displayPace: 0
    });
addToHome.show()

error

TypeError: Cannot read property 'lastDisplayTime' of undefined
    at ath.Class.show (addtohomescreen.js:465)

Solution.

check this.session inside show method.

line 445:

show: function (force) {
	  // don not start if session not exist
	   if(!this.session) {
	    return
    }
...
gimox added a commit to gimox/add-to-homescreen that referenced this issue Jun 23, 2017
fix error on desktop environment when force show
@BumbleB2na
Copy link

Not just for desktop but also in situations where plugin decides the popup has "already been shown on screen". I wanted to manually trigger the popup to show if you click a button, in case some people missed it the first time. To overcome this I had to set my [addToHomeVar].show = false; before triggering: [addToHomeVar].show(); - I would have rather just used [addToHomeVar].show(true); to force it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants