]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/common/Header.js
restore page after login
[alttp.git] / resources / js / components / common / Header.js
index 96106a175491a142488ee8e2b903beec945b24da..6868477b54328a3078e16d8f10103f6ee446f92e 100644 (file)
@@ -52,7 +52,15 @@ const Header = ({ doLogout, user }) =>
                                                </Button>
                                        </>
                                :
-                                       <Button href="/login" variant="discord">
+                                       <Button
+                                               href="/login"
+                                               onClick={() => {
+                                                       if (location.pathname.length > 1) {
+                                                               localStorage.setItem('returnPath', location.pathname.substr(1));
+                                                       }
+                                               }}
+                                               variant="discord"
+                                       >
                                                <Icon.DISCORD />
                                                {' '}
                                                {i18n.t('button.login')}