File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -836,9 +836,11 @@ <h2 id="single-item-name" class="single-item-name"></h2>
836836
837837 document . getElementById ( 'logout-btn' ) . addEventListener ( 'click' , handleLogout ) ;
838838 document . getElementById ( 'create-item-btn' ) . addEventListener ( 'click' , createNewItem ) ;
839- document . getElementsByClassName ( 'login-btn' ) [ 0 ] . addEventListener ( 'click' , ( ) => {
839+ document . getElementsByClassName ( 'login-btn' ) [ 0 ] . addEventListener ( 'click' , loginToInventory ) ;
840+
841+ function loginToInventory ( ) {
840842 window . location . href = 'https://rotur.dev/auth?return_to=' + encodeURIComponent ( window . location . href ) ;
841- } ) ;
843+ }
842844 } ) ;
843845
844846 async function validateAuthAndFetchUser ( token ) {
@@ -1009,7 +1011,7 @@ <h2 id="single-item-name" class="single-item-name"></h2>
10091011 } else if ( item . selling && ( ! authToken || ! currentUser ) ) {
10101012 actionsHTML = `
10111013 <p style="color: #aaa; font-style: italic;">Login to purchase this item</p>
1012- <button onclick="window.location.href='https://rotur.dev/auth' " class="single-item-buy-btn">Login</button>
1014+ <button onclick="loginToInventory() " class="single-item-buy-btn">Login</button>
10131015 ` ;
10141016 } else if ( item . owner && authToken && currentUser && item . owner . toLowerCase ( ) === currentUser . toLowerCase ( ) ) {
10151017 actionsHTML = `
You can’t perform that action at this time.
0 commit comments