Browse Source

disallow new-project page if not registered

kb/add-usage-guide
Trent Larson 7 months ago
parent
commit
c107073592
  1. 3
      src/views/HomeView.vue
  2. 9
      src/views/ProjectsView.vue

3
src/views/HomeView.vue

@ -95,8 +95,7 @@
v-else-if="!isRegistered"
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
>
Someone must register your identifier before you can record anyone's
giving.
Someone must register you before you can give or offer.
<router-link
:to="{ name: 'contact-qr' }"
class="block text-center text-md font-bold bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white mt-2 px-2 py-3 rounded-md"

9
src/views/ProjectsView.vue

@ -62,7 +62,7 @@
<!-- New Project -->
<button
v-if="showProjects"
v-if="isRegistered && showProjects"
class="fixed right-6 bottom-24 text-center text-4xl leading-none bg-blue-600 text-white w-14 py-2.5 rounded-full"
@click="onClickNewProject()"
>
@ -236,6 +236,7 @@ export default class ProjectsView extends Vue {
projects: PlanData[] = [];
currentIid: IIdentifier;
isLoading = false;
isRegistered = false;
numAccounts = 0;
offers: OfferSummaryRecord[] = [];
showOffers = true;
@ -243,15 +244,13 @@ export default class ProjectsView extends Vue {
libsUtil = libsUtil;
/**
* 'created' hook runs when the Vue instance is first created
**/
async created() {
async mounted() {
try {
await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY);
const activeDid: string = (settings?.activeDid as string) || "";
this.apiServer = (settings?.apiServer as string) || "";
this.isRegistered = !!settings?.isRegistered;
await accountsDB.open();
this.numAccounts = await accountsDB.accounts.count();

Loading…
Cancel
Save