Ccvault connect isn't working
Closed this issue · 5 comments
When I click on Ccvault, the Nami connect windows opens up.
'ccvault' should be 'Ccvault' for the case of the getWallet() function in extensions.js
I created a PR with the fix: #1
The "ccvault" is the correct string unless you did an overwrite to the template that uses "Ccvault" here
<button x-on:click.prevent="isConnected ? handleReconnect('ccvault') : handleConnect('ccvault')" x-bind:disabled="isDisabled('ccvault')">
Oh.. I must have done exactly that in the custom theme files, as it's called Ccvault everywhere else, and the others are also starting with a capital letter. Wouldn't it be better to change the button to use Ccvault, too, so it's the same across all wallets/files?
Yes, but only in code(variables, properties, methods, etc.) to follow the camelCase format. Anywhere else should follow how they are branded.
Also, if you just mean to "normalize" them in the front, you definitely can update the button labels to your liking.
https://github.com/pbwebdev/cardanopress/blob/main/templates/part/modal-content.php#L23-L29
<button x-on:click.prevent="isConnected ? handleReconnect('ccvault') : handleConnect('ccvault')" x-bind:disabled="isDisabled('ccvault')">
Ccvault.io <!-- ? or CCVAULT or <svg>-->
<template x-if="!isAvailable || !has('Ccvault')">
<span class="block italic text-sm">(Not available)</span>
</template>
</button>
What I meant is, that it calls it for ccvault like this:
handleConnect('ccvault')
while the other 3 use:
handleConnect('Nami')
handleConnect('Yoroi')
handleConnect('Flint')
But I understand the point about only doing it for camelCase. I guess you can close this issue, and I just get used to it being lowercase. :)
The value there is what gets saved to the localStorage
https://github.com/pbwebdev/cardanopress/blob/main/assets/src/main.js#L88
to be able to trace which extension was used
https://github.com/pbwebdev/cardanopress/blob/main/assets/src/main.js#L54
implemented here to show to the user
https://github.com/pbwebdev/cardanopress/blob/main/templates/part/profile-connection.php#L32