fix problem clicking on offer-delivery, plus some other hardening and phrasing
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
<h1 class="text-xl font-bold text-center mb-4 relative">
|
<h1 class="text-xl font-bold text-center mb-4 relative">
|
||||||
Welcome to Time Safari
|
Welcome to Time Safari
|
||||||
<br />
|
<br />
|
||||||
- Showcasing Gratitude & Magnifying Time
|
- Showcase Impact & Magnify Time
|
||||||
<div
|
<div
|
||||||
class="text-lg text-center leading-none absolute right-0 -top-1"
|
class="text-lg text-center leading-none absolute right-0 -top-1"
|
||||||
@click="onClickClose(true)"
|
@click="onClickClose(true)"
|
||||||
@@ -14,6 +14,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
|
The feed underneath this pop-up shows the latest contributions,
|
||||||
|
some from people and some from projects.
|
||||||
|
|
||||||
<p v-if="isRegistered" class="mt-4">
|
<p v-if="isRegistered" class="mt-4">
|
||||||
You can now log things that you've seen:
|
You can now log things that you've seen:
|
||||||
<span v-if="numContacts > 0">
|
<span v-if="numContacts > 0">
|
||||||
@@ -23,14 +26,11 @@
|
|||||||
<span class="bg-green-600 text-white rounded-full">
|
<span class="bg-green-600 text-white rounded-full">
|
||||||
<font-awesome icon="plus" class="fa-fw" />
|
<font-awesome icon="plus" class="fa-fw" />
|
||||||
</span>
|
</span>
|
||||||
button to express your appreciation for... whatever -- maybe thanks for
|
button to express your appreciation for... whatever.
|
||||||
showing you all these fascinating stories of
|
|
||||||
<em>gratitude</em>.
|
|
||||||
</p>
|
</p>
|
||||||
<p v-else class="mt-4">
|
<p class="mt-4">
|
||||||
The feed underneath this pop-up shows the latest gifts that others have
|
Once someone registers you, you can log your
|
||||||
recognized. Once someone registers you, you can log your appreciation,
|
appreciation, too.
|
||||||
too.
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p class="mt-4">
|
<p class="mt-4">
|
||||||
|
|||||||
@@ -107,7 +107,6 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
|
|||||||
try {
|
try {
|
||||||
// Get default settings first
|
// Get default settings first
|
||||||
const defaultSettings = await retrieveSettingsForDefaultAccount();
|
const defaultSettings = await retrieveSettingsForDefaultAccount();
|
||||||
|
|
||||||
// If no active DID, return defaults
|
// If no active DID, return defaults
|
||||||
if (!defaultSettings.activeDid) {
|
if (!defaultSettings.activeDid) {
|
||||||
logConsoleAndDb(
|
logConsoleAndDb(
|
||||||
@@ -280,10 +279,8 @@ export function generateUpdateStatement(
|
|||||||
const params: unknown[] = [];
|
const params: unknown[] = [];
|
||||||
|
|
||||||
Object.entries(model).forEach(([key, value]) => {
|
Object.entries(model).forEach(([key, value]) => {
|
||||||
if (value !== undefined) {
|
|
||||||
setClauses.push(`${key} = ?`);
|
setClauses.push(`${key} = ?`);
|
||||||
params.push(value);
|
params.push(value ?? null);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (setClauses.length === 0) {
|
if (setClauses.length === 0) {
|
||||||
|
|||||||
@@ -416,8 +416,10 @@ export function offerGiverDid(
|
|||||||
*/
|
*/
|
||||||
export const canFulfillOffer = (
|
export const canFulfillOffer = (
|
||||||
veriClaim: GenericCredWrapper<GenericVerifiableCredential>,
|
veriClaim: GenericCredWrapper<GenericVerifiableCredential>,
|
||||||
|
isRegistered: boolean,
|
||||||
) => {
|
) => {
|
||||||
return (
|
return (
|
||||||
|
isRegistered &&
|
||||||
veriClaim.claimType === "Offer" &&
|
veriClaim.claimType === "Offer" &&
|
||||||
!!offerGiverDid(veriClaim as GenericCredWrapper<OfferClaim>)
|
!!offerGiverDid(veriClaim as GenericCredWrapper<OfferClaim>)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1239,6 +1239,7 @@ export default class AccountViewView extends Vue {
|
|||||||
*/
|
*/
|
||||||
async initializeState() {
|
async initializeState() {
|
||||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||||
|
console.log("settings", settings);
|
||||||
if (USE_DEXIE_DB) {
|
if (USE_DEXIE_DB) {
|
||||||
await db.open();
|
await db.open();
|
||||||
settings = await retrieveSettingsForActiveAccount();
|
settings = await retrieveSettingsForActiveAccount();
|
||||||
|
|||||||
@@ -206,7 +206,7 @@
|
|||||||
|
|
||||||
<div class="mt-8">
|
<div class="mt-8">
|
||||||
<button
|
<button
|
||||||
v-if="libsUtil.canFulfillOffer(veriClaim)"
|
v-if="libsUtil.canFulfillOffer(veriClaim, isRegistered)"
|
||||||
class="col-span-1 block w-fit text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
class="col-span-1 block w-fit text-center text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md"
|
||||||
@click="openFulfillGiftDialog()"
|
@click="openFulfillGiftDialog()"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -94,7 +94,7 @@
|
|||||||
<a
|
<a
|
||||||
href="#"
|
href="#"
|
||||||
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-8"
|
class="block w-full text-center text-md uppercase bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-8"
|
||||||
@click="switchAccount('0')"
|
@click="switchAccount(undefined)"
|
||||||
>
|
>
|
||||||
No Identity
|
No Identity
|
||||||
</a>
|
</a>
|
||||||
@@ -164,10 +164,6 @@ export default class IdentitySwitcherView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async switchAccount(did?: string) {
|
async switchAccount(did?: string) {
|
||||||
// 0 means none
|
|
||||||
if (did === "0") {
|
|
||||||
did = undefined;
|
|
||||||
}
|
|
||||||
await databaseUtil.updateDefaultSettings({ activeDid: did });
|
await databaseUtil.updateDefaultSettings({ activeDid: did });
|
||||||
if (USE_DEXIE_DB) {
|
if (USE_DEXIE_DB) {
|
||||||
await db.open();
|
await db.open();
|
||||||
|
|||||||
@@ -254,8 +254,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
|
|
||||||
</div>
|
</div>
|
||||||
|
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
|
||||||
|
|
||||||
<!-- Offers & Gifts to & from this -->
|
<!-- Offers & Gifts to & from this -->
|
||||||
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4 mt-4">
|
<div class="grid items-start grid-cols-1 sm:grid-cols-3 gap-4 mt-4">
|
||||||
@@ -1278,7 +1278,7 @@ export default class ProjectViewView extends Vue {
|
|||||||
claimType: "Offer",
|
claimType: "Offer",
|
||||||
issuer: offer.offeredByDid,
|
issuer: offer.offeredByDid,
|
||||||
};
|
};
|
||||||
return libsUtil.canFulfillOffer(offerRecord);
|
return libsUtil.canFulfillOffer(offerRecord, this.isRegistered);
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickFulfillGiveToOffer(offer: OfferSummaryRecord) {
|
onClickFulfillGiveToOffer(offer: OfferSummaryRecord) {
|
||||||
|
|||||||
Reference in New Issue
Block a user