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

    detect browser refresh? reroute to entry point?

    Help
    2
    3
    152
    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.
    • R
      rconstantine last edited by rconstantine

      My app is an SPA. When a user refreshes the page after clicking around and winding up on a path other than the root , the resulting page is messed up. Is there a way to detect the refresh? For example, even the slide-out menu of my default layout is empty as the user’s credentials seem to be lost. I think it’s vuex losing its data. I’m considering compiling to Electron so there isn’t a refresh button, but in an organization of 50,000 employees, it’s easier for me to publish a web app rather than deploy an exe.

      qyloxe 1 Reply Last reply Reply Quote 0
      • qyloxe
        qyloxe @rconstantine last edited by

        @rconstantine I can think of at least three ways to cope with this:

        1. there are those vuex plugins whose can serialize vuex state to the browsers indexedb and at the first access they load state from indexeddb. this alone just handles your problem. Just a quick results from google to show what is the mechanism:
          https://netterminalmachine.com/blog/2018/persisting-a-vuex-store-to-indexed-db
          https://github.com/abradley2/vuex-vip
          https://github.com/championswimmer/vuex-persist#readme

        2. there is a vuexorm which in its own way makes your SPA “better” and more resiliant.
          https://vuex-orm.github.io/vuex-orm/guide/prologue/what-is-vuex-orm.html

        3. there are psychological ways of interface building (“barriers”, “directional intents”) where user just do not wants to drag from the top resulting in page refresh. User is lead to believe, that she does not need to drag and drag and drag to the top of the page. It’s a job for a good designer obviously.

        1 Reply Last reply Reply Quote 1
        • R
          rconstantine last edited by

          Thanks for the reply. I’ll check these options out.

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