Browse Source

disallow new-project page if not registered

pull/115/head
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" v-else-if="!isRegistered"
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4" 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 Someone must register you before you can give or offer.
giving.
<router-link <router-link
:to="{ name: 'contact-qr' }" :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" 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 --> <!-- New Project -->
<button <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" 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()" @click="onClickNewProject()"
> >
@ -236,6 +236,7 @@ export default class ProjectsView extends Vue {
projects: PlanData[] = []; projects: PlanData[] = [];
currentIid: IIdentifier; currentIid: IIdentifier;
isLoading = false; isLoading = false;
isRegistered = false;
numAccounts = 0; numAccounts = 0;
offers: OfferSummaryRecord[] = []; offers: OfferSummaryRecord[] = [];
showOffers = true; showOffers = true;
@ -243,15 +244,13 @@ export default class ProjectsView extends Vue {
libsUtil = libsUtil; libsUtil = libsUtil;
/** async mounted() {
* 'created' hook runs when the Vue instance is first created
**/
async created() {
try { try {
await db.open(); await db.open();
const settings = await db.settings.get(MASTER_SETTINGS_KEY); const settings = await db.settings.get(MASTER_SETTINGS_KEY);
const activeDid: string = (settings?.activeDid as string) || ""; const activeDid: string = (settings?.activeDid as string) || "";
this.apiServer = (settings?.apiServer as string) || ""; this.apiServer = (settings?.apiServer as string) || "";
this.isRegistered = !!settings?.isRegistered;
await accountsDB.open(); await accountsDB.open();
this.numAccounts = await accountsDB.accounts.count(); this.numAccounts = await accountsDB.accounts.count();

Loading…
Cancel
Save