forked from trent_larson/crowd-funder-for-time-pwa
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">
|
||||
Welcome to Time Safari
|
||||
<br />
|
||||
- Showcasing Gratitude & Magnifying Time
|
||||
- Showcase Impact & Magnify Time
|
||||
<div
|
||||
class="text-lg text-center leading-none absolute right-0 -top-1"
|
||||
@click="onClickClose(true)"
|
||||
@@ -14,6 +14,9 @@
|
||||
</div>
|
||||
</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">
|
||||
You can now log things that you've seen:
|
||||
<span v-if="numContacts > 0">
|
||||
@@ -23,14 +26,11 @@
|
||||
<span class="bg-green-600 text-white rounded-full">
|
||||
<font-awesome icon="plus" class="fa-fw" />
|
||||
</span>
|
||||
button to express your appreciation for... whatever -- maybe thanks for
|
||||
showing you all these fascinating stories of
|
||||
<em>gratitude</em>.
|
||||
button to express your appreciation for... whatever.
|
||||
</p>
|
||||
<p v-else class="mt-4">
|
||||
The feed underneath this pop-up shows the latest gifts that others have
|
||||
recognized. Once someone registers you, you can log your appreciation,
|
||||
too.
|
||||
<p class="mt-4">
|
||||
Once someone registers you, you can log your
|
||||
appreciation, too.
|
||||
</p>
|
||||
|
||||
<p class="mt-4">
|
||||
|
||||
@@ -107,7 +107,6 @@ export async function retrieveSettingsForActiveAccount(): Promise<Settings> {
|
||||
try {
|
||||
// Get default settings first
|
||||
const defaultSettings = await retrieveSettingsForDefaultAccount();
|
||||
|
||||
// If no active DID, return defaults
|
||||
if (!defaultSettings.activeDid) {
|
||||
logConsoleAndDb(
|
||||
@@ -280,10 +279,8 @@ export function generateUpdateStatement(
|
||||
const params: unknown[] = [];
|
||||
|
||||
Object.entries(model).forEach(([key, value]) => {
|
||||
if (value !== undefined) {
|
||||
setClauses.push(`${key} = ?`);
|
||||
params.push(value);
|
||||
}
|
||||
setClauses.push(`${key} = ?`);
|
||||
params.push(value ?? null);
|
||||
});
|
||||
|
||||
if (setClauses.length === 0) {
|
||||
|
||||
@@ -416,8 +416,10 @@ export function offerGiverDid(
|
||||
*/
|
||||
export const canFulfillOffer = (
|
||||
veriClaim: GenericCredWrapper<GenericVerifiableCredential>,
|
||||
isRegistered: boolean,
|
||||
) => {
|
||||
return (
|
||||
isRegistered &&
|
||||
veriClaim.claimType === "Offer" &&
|
||||
!!offerGiverDid(veriClaim as GenericCredWrapper<OfferClaim>)
|
||||
);
|
||||
|
||||
@@ -1239,6 +1239,7 @@ export default class AccountViewView extends Vue {
|
||||
*/
|
||||
async initializeState() {
|
||||
let settings = await databaseUtil.retrieveSettingsForActiveAccount();
|
||||
console.log("settings", settings);
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
settings = await retrieveSettingsForActiveAccount();
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
<div class="mt-8">
|
||||
<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"
|
||||
@click="openFulfillGiftDialog()"
|
||||
>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<a
|
||||
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"
|
||||
@click="switchAccount('0')"
|
||||
@click="switchAccount(undefined)"
|
||||
>
|
||||
No Identity
|
||||
</a>
|
||||
@@ -164,10 +164,6 @@ export default class IdentitySwitcherView extends Vue {
|
||||
}
|
||||
|
||||
async switchAccount(did?: string) {
|
||||
// 0 means none
|
||||
if (did === "0") {
|
||||
did = undefined;
|
||||
}
|
||||
await databaseUtil.updateDefaultSettings({ activeDid: did });
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
|
||||
@@ -254,8 +254,8 @@
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
|
||||
</div>
|
||||
<GiftedDialog ref="giveDialogToThis" :to-project-id="projectId" />
|
||||
|
||||
<!-- Offers & Gifts to & from this -->
|
||||
<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",
|
||||
issuer: offer.offeredByDid,
|
||||
};
|
||||
return libsUtil.canFulfillOffer(offerRecord);
|
||||
return libsUtil.canFulfillOffer(offerRecord, this.isRegistered);
|
||||
}
|
||||
|
||||
onClickFulfillGiveToOffer(offer: OfferSummaryRecord) {
|
||||
|
||||
Reference in New Issue
Block a user