Skip to content

Commit 9f73e2d

Browse files
committed
fix the other login button
1 parent f040cf9 commit 9f73e2d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

inventory-manager.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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 = `

0 commit comments

Comments
 (0)