Skip to content

Instantly share code, notes, and snippets.

@yakatz
Created January 1, 2019 04:47
Show Gist options
  • Save yakatz/a6da1299b66cb9ac96075ab74a27bb03 to your computer and use it in GitHub Desktop.
Save yakatz/a6da1299b66cb9ac96075ab74a27bb03 to your computer and use it in GitHub Desktop.
Github login notification
window.addEventListener("storage", function(t) {
if (t.storageArea === window.localStorage && "logged-in" === t.key && ("true" === t.newValue || "false" === t.newValue) && t.newValue !== a) {
a = t.newValue;
var n = e.query(document, ".js-stale-session-flash");
n.classList.toggle("is-signed-in", "true" === a),
n.classList.toggle("is-signed-out", "false" === a),
n.classList.remove("d-none"),
window.addEventListener("popstate", function(e) {
e.state && null != e.state.container && location.reload()
}),
r.on("submit", "form", function(e) {
e.preventDefault()
})
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment