Merge pull request #519 from zenodeapp/master
Search bar case sensitivity fix and lowercased chainName
This commit is contained in:
commit
489971021e
@ -32,10 +32,10 @@ function changeEndpoint(item: Endpoint) {
|
||||
"
|
||||
class="capitalize whitespace-nowrap text-base font-semibold text-gray-600 dark:text-gray-200 hidden md:!block"
|
||||
>
|
||||
#{{
|
||||
baseStore.latest?.block?.header?.height ||
|
||||
chainStore.chainName ||
|
||||
''
|
||||
{{
|
||||
baseStore.latest?.block?.header?.height
|
||||
? `#${baseStore.latest.block.header.height}`
|
||||
: chainStore.chainName || ''
|
||||
}} <span class="text-error">{{ baseStore.connected ? '' : 'disconnected' }}</span>
|
||||
</div>
|
||||
<div
|
||||
|
@ -14,8 +14,11 @@ const dashboard = useDashboard();
|
||||
const keywords = ref('');
|
||||
const chains = computed(() => {
|
||||
if (keywords.value) {
|
||||
const lowercaseKeywords = keywords.value.toLowerCase();
|
||||
|
||||
return Object.values(dashboard.chains).filter(
|
||||
(x: ChainConfig) => x.chainName.indexOf(keywords.value) > -1
|
||||
(x: ChainConfig) => x.chainName.toLowerCase().indexOf(lowercaseKeywords) > -1
|
||||
|| x.prettyName.toLowerCase().indexOf(lowercaseKeywords) > -1
|
||||
);
|
||||
} else {
|
||||
return Object.values(dashboard.chains);
|
||||
|
@ -175,9 +175,20 @@ export const useBlockchain = defineStore('blockchain', {
|
||||
JSON.stringify(endpoint)
|
||||
);
|
||||
},
|
||||
setCurrent(name: string) {
|
||||
if (name !== this.chainName) {
|
||||
this.chainName = name;
|
||||
async setCurrent(name: string) {
|
||||
// Ensure chains are loaded due to asynchronous calls.
|
||||
if(this.dashboard.length === 0) {
|
||||
await this.dashboard.initial();
|
||||
}
|
||||
|
||||
// Find the case-sensitive name for the chainName, else simply use the parameter-value.
|
||||
const caseSensitiveName =
|
||||
Object.keys(this.dashboard.chains).find((x) => x.toLowerCase() === name.toLowerCase())
|
||||
|| name;
|
||||
|
||||
// Update chainName if needed
|
||||
if (caseSensitiveName !== this.chainName) {
|
||||
this.chainName = caseSensitiveName;
|
||||
}
|
||||
},
|
||||
supportModule(mod: string) {
|
||||
|
@ -275,9 +275,9 @@ export const useDashboard = defineStore('dashboard', {
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
initial() {
|
||||
this.loadingFromLocal();
|
||||
// this.loadingFromRegistry()
|
||||
async initial() {
|
||||
await this.loadingFromLocal();
|
||||
// await this.loadingFromRegistry()
|
||||
},
|
||||
loadingPrices() {
|
||||
const coinIds = [] as string[]
|
||||
|
Loading…
Reference in New Issue
Block a user