Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➖ remove getSetting #5999

Merged
merged 11 commits into from
May 17, 2023
47 changes: 0 additions & 47 deletions components/common/RampCredit.vue

This file was deleted.

45 changes: 0 additions & 45 deletions components/shared/AccountSelect.vue

This file was deleted.

5 changes: 2 additions & 3 deletions composables/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import type { ApiPromise } from '@polkadot/api'
import { getChainEndpointByPrefix } from '@/utils/chain'

export default function () {
const { $store } = useNuxtApp()
const { urlPrefix } = usePrefix()

const apiUrl = computed(() => {
const endpoint = getChainEndpointByPrefix(urlPrefix.value)
return endpoint || $store.getters.getSettings['apiUrl']
const endpoint: string = getChainEndpointByPrefix(urlPrefix.value) || ''
return endpoint
})

const apiInstance = computed<Promise<ApiPromise>>(() =>
Expand Down
3 changes: 0 additions & 3 deletions pages/_prefix/transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,6 @@ export default class Transfer extends mixins(
const availableNodesByPrefix: { value: string }[] =
this.$store.getters['availableNodesByPrefix']
const availableUrls = availableNodesByPrefix.map((node) => node.value)
if (usedNodeUrls.length === 0) {
usedNodeUrls.push(this.$store.getters.getSettings['apiUrl'])
}
if (usedNodeUrls.length < availableUrls.length) {
const nextTryUrls = availableUrls.filter(
(url) => !usedNodeUrls.includes(url)
Expand Down
3 changes: 0 additions & 3 deletions pages/rmrk/credit.vue

This file was deleted.

102 changes: 0 additions & 102 deletions utils/WithKeyring.ts

This file was deleted.

11 changes: 5 additions & 6 deletions utils/mixins/apiUrlMixin.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { Component, Vue } from 'nuxt-property-decorator'
import { Component, mixins } from 'nuxt-property-decorator'
import { getChainEndpointByPrefix } from '@/utils/chain'
import PrefixMixin from '@/utils/mixins/prefixMixin'

/*
* refer to https://stackoverflow.com/questions/51873087/unable-to-use-mixins-in-vue-with-typescript
* import { Component, Mixins } from 'nuxt-property-decorator';
* class ExtendedClass extends Mixins(ActualMixin) {
*/
@Component
export default class ApiUrlMixin extends Vue {
export default class ApiUrlMixin extends mixins(PrefixMixin) {
get apiUrl() {
const endpoint = getChainEndpointByPrefix(
this.$store.getters.currentUrlPrefix
)
return endpoint || this.$store.getters.getSettings['apiUrl']
const endpoint: string = getChainEndpointByPrefix(this.urlPrefix) || ''
return endpoint
}
}