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"
|
class="capitalize whitespace-nowrap text-base font-semibold text-gray-600 dark:text-gray-200 hidden md:!block"
|
||||||
>
|
>
|
||||||
#{{
|
{{
|
||||||
baseStore.latest?.block?.header?.height ||
|
baseStore.latest?.block?.header?.height
|
||||||
chainStore.chainName ||
|
? `#${baseStore.latest.block.header.height}`
|
||||||
''
|
: chainStore.chainName || ''
|
||||||
}} <span class="text-error">{{ baseStore.connected ? '' : 'disconnected' }}</span>
|
}} <span class="text-error">{{ baseStore.connected ? '' : 'disconnected' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
|
@ -14,8 +14,11 @@ const dashboard = useDashboard();
|
|||||||
const keywords = ref('');
|
const keywords = ref('');
|
||||||
const chains = computed(() => {
|
const chains = computed(() => {
|
||||||
if (keywords.value) {
|
if (keywords.value) {
|
||||||
|
const lowercaseKeywords = keywords.value.toLowerCase();
|
||||||
|
|
||||||
return Object.values(dashboard.chains).filter(
|
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 {
|
} else {
|
||||||
return Object.values(dashboard.chains);
|
return Object.values(dashboard.chains);
|
||||||
|
@ -175,9 +175,20 @@ export const useBlockchain = defineStore('blockchain', {
|
|||||||
JSON.stringify(endpoint)
|
JSON.stringify(endpoint)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
setCurrent(name: string) {
|
async setCurrent(name: string) {
|
||||||
if (name !== this.chainName) {
|
// Ensure chains are loaded due to asynchronous calls.
|
||||||
this.chainName = name;
|
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) {
|
supportModule(mod: string) {
|
||||||
|
@ -275,9 +275,9 @@ export const useDashboard = defineStore('dashboard', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
initial() {
|
async initial() {
|
||||||
this.loadingFromLocal();
|
await this.loadingFromLocal();
|
||||||
// this.loadingFromRegistry()
|
// await this.loadingFromRegistry()
|
||||||
},
|
},
|
||||||
loadingPrices() {
|
loadingPrices() {
|
||||||
const coinIds = [] as string[]
|
const coinIds = [] as string[]
|
||||||
|
Loading…
Reference in New Issue
Block a user