Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

this.state not preserved for resuming in this.async() #36

Closed
didrocks opened this issue Sep 28, 2016 · 2 comments
Closed

this.state not preserved for resuming in this.async() #36

didrocks opened this issue Sep 28, 2016 · 2 comments

Comments

@didrocks
Copy link

First, thanks for the codelab-components! It's awesome and really useful to have opensourced this :)

I'm having an issue with resume not fired up. Adding some debug, I observed that this.state doesn't keep the same value in _stateLoaded before and after this.async() call.

I added some debug logs in _stateLoaded:

      _stateLoaded: function() {
        console.log("State loaded: " + this.state.stepIndex)
        // allow everything render and initialize,
        // especially this.steps which runs at the same init level
        // as iron-localstorage (on attached).
        this.async(function() {
          console.log("Resume check: " + this.state.stepIndex)
          […]
        }, 500);
      },

So, here is what I'm seeing, on page load:

State loaded: 2
Resume check: 0

As you can see, this.state.stepIndex has changed. This is due to _selectedChanged being fired in between due to steps being initialized on attach.

One way could be to prevent the this.set('state.stepIndex', this.selected); assignement on attach via a loading variable, do you think of a better fix? (It sounds wrong to change this.selected, as resume isn't selected at this point).

didrocks added a commit to ubuntu/codelabs-source that referenced this issue Sep 28, 2016
…not working

Prepare a patch to reapply the fix for future use.
Fixes #3
Reported upstream as
googlecodelabs/codelab-components#36
didrocks added a commit to ubuntu/codelabs that referenced this issue Nov 9, 2016
…not working

Prepare a patch to reapply the fix for future use.
Fixes #3
Reported upstream as
googlecodelabs/codelab-components#36
@x1ddos
Copy link
Contributor

x1ddos commented Apr 17, 2018

@didrocks I'm afraid we will not be fixing this here but we're working on a drop-in replacement using just Custom Elements spec, without Polymer or other frameworks/libs, in https://github.com/googlecodelabs/codelab-elements.

See #49 for more details.

@x1ddos
Copy link
Contributor

x1ddos commented Apr 17, 2018

I'm closing this as "won't fix" for now. But please let me know if anyone wants to contribute and fix it here and I'll reopen. Otherwise, please check out the new repo.

@x1ddos x1ddos closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants