|
@ -77,58 +77,28 @@ |
|
|
|
|
|
|
|
|
<div v-else> |
|
|
<div v-else> |
|
|
<!-- !isCreatingIdentifier --> |
|
|
<!-- !isCreatingIdentifier --> |
|
|
<div |
|
|
<!-- They should have an identifier, even if it's an auto-generated one that they'll never use. --> |
|
|
v-if="!activeDid" |
|
|
<div class="mb-4"> |
|
|
class="bg-amber-200 rounded-md text-center px-4 py-3 mb-4" |
|
|
|
|
|
> |
|
|
|
|
|
<div v-if="PASSKEYS_ENABLED"> |
|
|
|
|
|
<p class="text-lg mb-3"> |
|
|
|
|
|
Choose how to see info from your contacts or share contributions: |
|
|
|
|
|
</p> |
|
|
|
|
|
<div class="flex justify-between"> |
|
|
|
|
|
<button |
|
|
|
|
|
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" |
|
|
|
|
|
@click="generateIdentifier()" |
|
|
|
|
|
> |
|
|
|
|
|
Let me start the easiest (with a passkey). |
|
|
|
|
|
</button> |
|
|
|
|
|
<router-link |
|
|
|
|
|
:to="{ name: 'start' }" |
|
|
|
|
|
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" |
|
|
|
|
|
> |
|
|
|
|
|
Give me all the options. |
|
|
|
|
|
</router-link> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else> |
|
|
|
|
|
<p class="text-lg mb-3"> |
|
|
|
|
|
To recognize giving or collaborate, have someone register you: |
|
|
|
|
|
</p> |
|
|
|
|
|
<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" |
|
|
|
|
|
> |
|
|
|
|
|
Share your contact info. |
|
|
|
|
|
</router-link> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div v-else class="mb-4"> |
|
|
|
|
|
<!-- activeDid --> |
|
|
|
|
|
|
|
|
|
|
|
<div |
|
|
<div |
|
|
v-if="!isRegistered" |
|
|
v-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" |
|
|
> |
|
|
> |
|
|
<!-- activeDid && !isRegistered --> |
|
|
<!-- activeDid && !isRegistered --> |
|
|
Someone must register you before you can give kudos or make offers |
|
|
To share, someone must register you. |
|
|
or create projects... basically before doing anything. |
|
|
|
|
|
<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" |
|
|
> |
|
|
> |
|
|
Show Them Your Identifier Info |
|
|
Show Them Default Identifier Info |
|
|
</router-link> |
|
|
</router-link> |
|
|
|
|
|
<div v-if="PASSKEYS_ENABLED" class="flex justify-end w-full"> |
|
|
|
|
|
<router-link |
|
|
|
|
|
:to="{ name: 'start' }" |
|
|
|
|
|
class="block text-right 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" |
|
|
|
|
|
> |
|
|
|
|
|
See all your options first |
|
|
|
|
|
</router-link> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div v-else> |
|
|
<div v-else> |
|
@ -340,7 +310,11 @@ import FeedFilters from "@/components/FeedFilters.vue"; |
|
|
import InfiniteScroll from "@/components/InfiniteScroll.vue"; |
|
|
import InfiniteScroll from "@/components/InfiniteScroll.vue"; |
|
|
import QuickNav from "@/components/QuickNav.vue"; |
|
|
import QuickNav from "@/components/QuickNav.vue"; |
|
|
import TopMessage from "@/components/TopMessage.vue"; |
|
|
import TopMessage from "@/components/TopMessage.vue"; |
|
|
import { AppString, NotificationIface, PASSKEYS_ENABLED } from "@/constants/app"; |
|
|
import { |
|
|
|
|
|
AppString, |
|
|
|
|
|
NotificationIface, |
|
|
|
|
|
PASSKEYS_ENABLED, |
|
|
|
|
|
} from "@/constants/app"; |
|
|
import { db, accountsDB } from "@/db/index"; |
|
|
import { db, accountsDB } from "@/db/index"; |
|
|
import { Contact } from "@/db/tables/contacts"; |
|
|
import { Contact } from "@/db/tables/contacts"; |
|
|
import { |
|
|
import { |
|
@ -359,7 +333,10 @@ import { |
|
|
GiverReceiverInputInfo, |
|
|
GiverReceiverInputInfo, |
|
|
GiveSummaryRecord, |
|
|
GiveSummaryRecord, |
|
|
} from "@/libs/endorserServer"; |
|
|
} from "@/libs/endorserServer"; |
|
|
import { registerSaveAndActivatePasskey } from "@/libs/util"; |
|
|
import { |
|
|
|
|
|
generateSaveAndActivateIdentity, |
|
|
|
|
|
registerSaveAndActivatePasskey, |
|
|
|
|
|
} from "@/libs/util"; |
|
|
|
|
|
|
|
|
interface GiveRecordWithContactInfo extends GiveSummaryRecord { |
|
|
interface GiveRecordWithContactInfo extends GiveSummaryRecord { |
|
|
giver: { |
|
|
giver: { |
|
@ -423,7 +400,14 @@ export default class HomeView extends Vue { |
|
|
try { |
|
|
try { |
|
|
await accountsDB.open(); |
|
|
await accountsDB.open(); |
|
|
const allAccounts = await accountsDB.accounts.toArray(); |
|
|
const allAccounts = await accountsDB.accounts.toArray(); |
|
|
this.allMyDids = allAccounts.map((acc) => acc.did); |
|
|
if (allAccounts.length > 0) { |
|
|
|
|
|
this.allMyDids = allAccounts.map((acc) => acc.did); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.isCreatingIdentifier = true; |
|
|
|
|
|
const newDid = await generateSaveAndActivateIdentity(); |
|
|
|
|
|
this.isCreatingIdentifier = false; |
|
|
|
|
|
this.allMyDids = [newDid]; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
await db.open(); |
|
|
await db.open(); |
|
|
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings; |
|
|
const settings = (await db.settings.get(MASTER_SETTINGS_KEY)) as Settings; |
|
@ -440,6 +424,7 @@ export default class HomeView extends Vue { |
|
|
|
|
|
|
|
|
this.isAnyFeedFilterOn = isAnyFeedFilterOn(settings); |
|
|
this.isAnyFeedFilterOn = isAnyFeedFilterOn(settings); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// someone may have have registered after sharing contact info, so recheck |
|
|
// someone may have have registered after sharing contact info, so recheck |
|
|
if (!this.isRegistered && this.activeDid) { |
|
|
if (!this.isRegistered && this.activeDid) { |
|
|
try { |
|
|
try { |
|
@ -481,7 +466,7 @@ export default class HomeView extends Vue { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
async generateIdentifier() { |
|
|
async generatePasskeyIdentifier() { |
|
|
this.isCreatingIdentifier = true; |
|
|
this.isCreatingIdentifier = true; |
|
|
const account = await registerSaveAndActivatePasskey( |
|
|
const account = await registerSaveAndActivatePasskey( |
|
|
AppString.APP_NAME + (this.givenName ? " - " + this.givenName : ""), |
|
|
AppString.APP_NAME + (this.givenName ? " - " + this.givenName : ""), |
|
|