diff --git a/src/views/ClaimView.vue b/src/views/ClaimView.vue index 825d570..0d26ca1 100644 --- a/src/views/ClaimView.vue +++ b/src/views/ClaimView.vue @@ -45,21 +45,7 @@
- {{ veriClaim.issuer }} - - - Copied DID - + {{ didInfo(veriClaim.issuer) }}
@@ -519,7 +505,6 @@ export default class ClaimView extends Vue { isRegistered = false; numConfsNotVisible = 0; // number of hidden DIDs in the confirmerIdList, minus the issuer if they aren't visible providersForGive: ProviderInfo[] = []; - showDidCopy = false; showIdCopy = false; showVeriClaimDump = false; veriClaim = serverUtil.BLANK_GENERIC_SERVER_RECORD; diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index ffe5c3b..f7e858a 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -198,7 +198,7 @@
diff --git a/src/views/NewActivityView.vue b/src/views/NewActivityView.vue index 7f5bcb4..8d7f5e5 100644 --- a/src/views/NewActivityView.vue +++ b/src/views/NewActivityView.vue @@ -16,26 +16,26 @@
-
-
- New Offers To You - -
+
{{ newOffersToUser.length }} + New Offer{{ newOffersToUser.length === 1 ? "" : "s" }} To You +
-
    -
  • +
      +
    • {{ didInfo(offer.offeredByDid, activeDid, allMyDids, allContacts) }} offers - {{ offer.description }} + {{ offer.objectDescription }} {{ displayAmount(offer.unit, offer.amount) }} @@ -45,6 +45,14 @@ > + +
@@ -58,7 +66,7 @@ import GiftedDialog from "@/components/GiftedDialog.vue"; import QuickNav from "@/components/QuickNav.vue"; import EntityIcon from "@/components/EntityIcon.vue"; import { NotificationIface } from "@/constants/app"; -import { accountsDB, db, retrieveSettingsForActiveAccount } from "@/db/index"; +import { accountsDB, db, retrieveSettingsForActiveAccount, updateAccountSettings } from "@/db/index"; import { Contact } from "@/db/tables/contacts"; import { didInfo, @@ -120,5 +128,49 @@ export default class NewActivityView extends Vue { ); } } + + async expandOffersToUserAndMarkRead() { + this.showOffersDetails = !this.showOffersDetails; + if (this.newOffersToUser.length > 0) { + await updateAccountSettings(this.activeDid, { + lastAckedOfferToUserJwtId: this.newOffersToUser[0].jwtId, + }); + // note that we don't update this.lastAckedOfferToUserJwtId in case they + // later choose the last one to keep the offers as new + } + this.$notify( + { + group: "alert", + type: "info", + title: "Marked as Read", + text: "The offers are marked as viewed. Click in the list to keep them as new.", + }, + 5000, + ); + } + + async markOffersAsReadStartingWith(jwtId: string) { + const index = this.newOffersToUser.findIndex(offer => offer.jwtId === jwtId); + if (index !== -1 && index < this.newOffersToUser.length - 1) { + // Set to the next offer's jwtId + await updateAccountSettings(this.activeDid, { + lastAckedOfferToUserJwtId: this.newOffersToUser[index + 1].jwtId, + }); + } else { + // it's the last entry (or not found), so just keep it the same + await updateAccountSettings(this.activeDid, { + lastAckedOfferToUserJwtId: this.lastAckedOfferToUserJwtId, + }); + } + this.$notify( + { + group: "alert", + type: "info", + title: "Marked as Unread", + text: "All offers above that one are marked as unread.", + }, + 3000, + ); + } }