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

Persistedstates >> Save credits on refresh #2

Open
borsTiHD opened this issue Jul 19, 2022 · 2 comments
Open

Persistedstates >> Save credits on refresh #2

borsTiHD opened this issue Jul 19, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@borsTiHD
Copy link
Owner

Make credits and upcoming statistic persistent.
Data should be safe after a refresh.
For example with: https://github.com/prazdevs/pinia-plugin-persistedstate

@borsTiHD borsTiHD added the enhancement New feature or request label Jul 19, 2022
@Saeed-Paris
Copy link

@borsTiHD hi i really wanna help u but i got an error when i tried to install deps. i think they have a conflict on versions (idk which one specific) do u know a way that i can install deps?

@borsTiHD
Copy link
Owner Author

Hi @Saeed-Paris, thanks for your message and help. I didn't expect anyone to write here, which is why I only now came across your comment. :D
What kind of error do you get? Its still working on my side.
Apart from the deps from the package.json I currently use the following:

  • Node: v16.16.0
  • npm: v8.16.0

For the issue itself, I would want to completely avoid additional packages at this time and store the credits in the Pinia actions using the following methods:

        resetCredits() {
            this.credits = 500
            localStorage['app-credits'] = this.credits
        },
        addCredits(amount) {
            this.credits += amount
            localStorage['app-credits'] = this.credits
        },
        subtractCredits(amount) {
            this.credits -= amount
            localStorage['app-credits'] = this.credits
        }

Would then just need a way to load the credits from localStorage on refresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants