mirror of
https://github.com/Such-Software/wownerogue.git
synced 2026-11-14 11:03:53 +01:00
fix: expose Smirk account entry in free Tavern mode
This commit is contained in:
@@ -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');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user