Skip to content

Commit

Permalink
fix: use username as a fallback if the address moved offline
Browse files Browse the repository at this point in the history
  • Loading branch information
kelsos committed Nov 28, 2024
1 parent d567b92 commit b01df02
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions layouts/account.vue
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { get } from '@vueuse/core';
import { storeToRefs } from 'pinia';
import Default from '~/layouts/default.vue';
import { useMainStore } from '~/store';
import { commonAttrs, noIndex } from '~/utils/metadata';
import Default from '~/layouts/default.vue';
const { t } = useI18n();
const store = useMainStore();
const { account } = storeToRefs(store);
const { account } = storeToRefs(useMainStore());
const name = computed(() => {
const name = computed<string>(() => {
const accountVal = get(account);
if (!accountVal)
return '';
const { firstName, lastName } = accountVal.address;
const { firstName, lastName, movedOffline } = accountVal.address;
if (movedOffline) {
return accountVal.username;
}
return `${firstName} ${lastName}`;
});
Expand Down

0 comments on commit b01df02

Please sign in to comment.