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

Fix/null account search #806

Merged
merged 2 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/components/AccountCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export default defineComponent({
const createTransaction = ref<string>('');
const creatingAccount = ref('');
const system_account = ref('eosio');
const system_null = ref('eosio.null');

const isLoading = ref<boolean>(true);
const tokensLoading = ref<boolean>(true);
Expand Down Expand Up @@ -177,7 +178,7 @@ export default defineComponent({

const loadResources = () => {
let ramDenominator;
if (props.account !== system_account.value) {
if (props.account !== system_account.value && props.account !== system_null.value) {
// display max resource unit value for readability
const ramMaxNumber = Number(accountData.value.ram_quota);
const ramUnitResult = determineUnit(ramMaxNumber);
Expand Down Expand Up @@ -444,6 +445,7 @@ export default defineComponent({
rexDeposits,
none,
system_account,
system_null,
radius,
availableTokens,
createTime,
Expand Down Expand Up @@ -517,7 +519,7 @@ export default defineComponent({
</div>
<q-space/>
</div>
<div v-if="account !== system_account" class="resources">
<div v-if="account !== system_account && account !== system_null" class="resources">
<PercentCircle
v-if="!accountPageSettings.hideCpuInfo"
:radius="radius"
Expand Down Expand Up @@ -732,6 +734,8 @@ $medium:750px
display: flex
align-items: center
justify-content: center
width: fit-content
margin: auto

.text-subtitle
text-transform: uppercase
Expand Down
20 changes: 10 additions & 10 deletions src/components/AccountSearch.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { defineComponent, ref, watch, onMounted } from 'vue';
import { OptionsObj } from 'src/types';
import { OptionsObj, TableByScope } from 'src/types';
import { api } from 'src/api';
import { useQuasar } from 'quasar';

Expand Down Expand Up @@ -90,22 +90,22 @@ export default defineComponent({
};
const accounts = await api.getTableByScope(request);

// because the get table by scope for userres does not include eosio system or null accounts
if (value.includes('eosio')) {
accounts.push(...[{
payer: 'eosio',
} as TableByScope, {
payer: 'eosio.null',
} as TableByScope]);
}

if (accounts.length > 0) {
results.push({
label: 'Accounts',
to: '',
isHeader: true,
});

// because the get table by scope for userres does not include eosio account
if ('eosio'.includes(value)) {
results.push({
label: 'eosio',
to: 'eosio',
isHeader: false,
});
}

accounts.forEach((user) => {
if (user.payer.includes(value)) {
results.push({
Expand Down
20 changes: 10 additions & 10 deletions src/components/HeaderSearch.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { defineComponent, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { OptionsObj } from 'src/types';
import { OptionsObj, TableByScope } from 'src/types';
import { api } from 'src/api';
import { isValidTransactionHex } from 'src/utils/string-utils';
import { useQuasar } from 'quasar';
Expand Down Expand Up @@ -48,22 +48,22 @@ export default defineComponent({
};
const accounts = await api.getTableByScope(request);

// because the get table by scope for userres does not include eosio system or null accounts
if (value.includes('eosio')) {
accounts.push(...[{
payer: 'eosio',
} as TableByScope, {
payer: 'eosio.null',
} as TableByScope]);
}

if (accounts.length > 0) {
results.push({
label: 'Accounts',
to: '',
isHeader: true,
});

// because the get table by scope for userres does not include eosio account
if ('eosio'.includes(value)) {
results.push({
label: 'eosio',
to: '/account/eosio',
isHeader: false,
});
}

accounts.forEach((user) => {
if (user.payer.includes(value)) {
results.push({
Expand Down
Loading