Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-8033

Prevent exiting compass / reloading pages in compass-web without warning when tabs are "dirty"

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Tabs, Web
    • None
    • Developer Tools
    • 3
    • Iteration Light Year, Iteration Milky Way, Iteration Neptune, Iteration Ozone

      We should add a beforeunload event handler that will prevent the page from reloading / unloading if tabs are "dirty", this event will cover both page reloads in browser and exiting the app in electron. In the browser environment this automatically prompts user with a browser dialog that covers our case of warning, but in electron it just silently prevents reload from happening, so we need to account for that.

      Another thing to consider here is how it interacts with the warning we show already in compass desktop on Ctrl+Q press, we probably don't want two warnings to show in sequence in that case?

      This also has implications on our e2e tests that we should figure out how to handle when adding this event listener

            Assignee:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Reporter:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: