fix: expose Smirk account entry in free Tavern mode

This commit is contained in:
2026-10-21 15:06:00 -04:00
parent fd7f975b80
commit 2e85adffde
7 changed files with 313 additions and 25 deletions
+3 -3
View File
@@ -318,7 +318,7 @@ const SmirkAuth = {
* Create and return the Smirk login button element
*/
_createButton() {
const btn = $('<button id="smirkLoginBtn" class="menu-button">')
const btn = $('<button id="smirkLoginBtn" type="button" class="menu-button">')
.css({
'background': '#1a1a4d',
'color': '#fff',
@@ -330,7 +330,7 @@ const SmirkAuth = {
'width': '100%',
'text-align': 'center'
})
.text('Connect Smirk Wallet');
.text('Connect Smirk');
return btn;
},
@@ -363,7 +363,7 @@ const SmirkAuth = {
default: // 'ready'
btn.prop('disabled', false)
.css({ 'background': '#1a1a4d', 'border-color': '#3a3a7d', 'cursor': 'pointer' })
.text('Connect Smirk Wallet');
.text('Connect Smirk');
}
},
+12
View File
@@ -18,6 +18,7 @@ const SocketHandlers = {
_directModeEnabled: false,
_directPayoutsEnabled: false,
_anyPayoutsEnabled: false,
_paymentsEnabled: false,
_isSmirkExplicitlyEnabled: function(data) {
return !!data && data.smirkEnabled === true;
@@ -874,6 +875,10 @@ const SocketHandlers = {
},
onAddressPrompt: function(data) {
if (!SocketHandlers._anyPayoutsEnabled) {
console.warn('Ignoring payout address prompt while payouts are disabled.');
return;
}
if (typeof AddressModal !== 'undefined') {
AddressModal.show({
existingAddress: data?.existingAddress || null,
@@ -916,7 +921,14 @@ const SocketHandlers = {
&& data.modes.match.economies.crypto_race);
var anyPayouts = SocketHandlers._creditsPayoutsEnabled
|| SocketHandlers._directPayoutsEnabled || matchCryptoPayouts;
SocketHandlers._anyPayoutsEnabled = anyPayouts;
$('#manageAddressButton').toggle(anyPayouts);
$('#smirkAccountSection').toggle(SocketHandlers._smirkEnabled);
if (SocketHandlers._smirkEnabled && window.location.hash === '#smirkAccountSection'
&& document.activeElement === document.body) {
document.getElementById('smirkAccountSection')?.focus({ preventScroll: true });
}
if (!anyPayouts && typeof AddressModal !== 'undefined') AddressModal.hide();
if (data.entitlements && typeof SinglePlayerAvatar !== 'undefined') {
SinglePlayerAvatar.applyEntitlements(data.entitlements);
}
+3
View File
@@ -53,6 +53,9 @@
},
show({ existingAddress = null, message = null } = {}) {
if (typeof SocketHandlers === 'undefined' || SocketHandlers._anyPayoutsEnabled !== true) {
return;
}
this.ensureInit();
if (!this._elements.overlay.length) {
return;