No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Handle browser hard refresh

    Help
    2
    3
    1721
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • krsyoung
      krsyoung last edited by

      I think this is more a generic Vue / client-side problem but thought I’d see if anybody had handy tricks here considering Quasar.

      Basically, how do you warn a user that they are doing a hard refresh which will blow away their Vuex / auth state?

      I’ve seen some suggestions on using a beforeUnload handler attached to the main app. Anybody have experience, particularly something that would not mess up how the app behaves within Cordova under iOS/Android?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • eleina
        eleina last edited by

        Had the same issue a long time ago, I think I have used an extra plugin called Vuex Persisted State.
        You can find it here https://www.npmjs.com/package/vuex-persistedstate

        1 Reply Last reply Reply Quote 2
        • krsyoung
          krsyoung last edited by

          Cool, thanks @eleina! I’ll investigate going down that path. I was also thinking of trying to just warn the user for starters (i.e. are you sure you want to refresh the page, you’ll lose any unsaved work). Main reason being the app I’m working on has data that is a little sensitive to persist.

          Appreciate the suggestion, will let you know how it goes.

          1 Reply Last reply Reply Quote 1
          • First post
            Last post