|
@ -57,12 +57,12 @@ |
|
|
v-for="contact in allContacts" |
|
|
v-for="contact in allContacts" |
|
|
:key="contact.did" |
|
|
:key="contact.did" |
|
|
@click="openDialog(contact)" |
|
|
@click="openDialog(contact)" |
|
|
style="color: blue" |
|
|
class="text-blue-500" |
|
|
> |
|
|
> |
|
|
{{ contact.name }}, |
|
|
{{ contact.name }}, |
|
|
</button> |
|
|
</button> |
|
|
or |
|
|
or |
|
|
<button @click="openDialog()" style="color: blue"> |
|
|
<button @click="openDialog()" class="text-blue-500"> |
|
|
nobody in particular |
|
|
nobody in particular |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
@ -85,8 +85,14 @@ |
|
|
<li |
|
|
<li |
|
|
class="border-b border-slate-300" |
|
|
class="border-b border-slate-300" |
|
|
v-for="record in feedData" |
|
|
v-for="record in feedData" |
|
|
:key="record.id" |
|
|
:key="record.jwtId" |
|
|
> |
|
|
> |
|
|
|
|
|
<div |
|
|
|
|
|
class="border-b text-orange-400 px-8 py-4" |
|
|
|
|
|
v-if="record.jwtId == feedLastViewedId" |
|
|
|
|
|
> |
|
|
|
|
|
You've seen all claims below. |
|
|
|
|
|
</div> |
|
|
{{ this.giveDescription(record) }} |
|
|
{{ this.giveDescription(record) }} |
|
|
</li> |
|
|
</li> |
|
|
</ul> |
|
|
</ul> |
|
@ -129,8 +135,8 @@ export default class HomeView extends Vue { |
|
|
feedAllLoaded = false; |
|
|
feedAllLoaded = false; |
|
|
feedData = []; |
|
|
feedData = []; |
|
|
feedPreviousOldestId = null; |
|
|
feedPreviousOldestId = null; |
|
|
|
|
|
feedLastViewedId = null; |
|
|
isHiddenSpinner = true; |
|
|
isHiddenSpinner = true; |
|
|
showInput = false; |
|
|
|
|
|
|
|
|
|
|
|
// 'created' hook runs when the Vue instance is first created |
|
|
// 'created' hook runs when the Vue instance is first created |
|
|
async created() { |
|
|
async created() { |
|
@ -140,6 +146,7 @@ export default class HomeView extends Vue { |
|
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY); |
|
|
const settings = await db.settings.get(MASTER_SETTINGS_KEY); |
|
|
this.activeDid = settings?.activeDid || ""; |
|
|
this.activeDid = settings?.activeDid || ""; |
|
|
this.allContacts = await db.contacts.toArray(); |
|
|
this.allContacts = await db.contacts.toArray(); |
|
|
|
|
|
this.feedLastViewedId = settings?.lastViewedClaimId; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 'mounted' hook runs after initial render |
|
|
// 'mounted' hook runs after initial render |
|
@ -168,7 +175,19 @@ export default class HomeView extends Vue { |
|
|
this.feedData = this.feedData.concat(results.data); |
|
|
this.feedData = this.feedData.concat(results.data); |
|
|
//console.log("Feed data:", this.feedData); |
|
|
//console.log("Feed data:", this.feedData); |
|
|
this.feedAllLoaded = results.hitLimit; |
|
|
this.feedAllLoaded = results.hitLimit; |
|
|
this.feedPreviousOldestId = results.data[results.data.length - 1].id; |
|
|
this.feedPreviousOldestId = |
|
|
|
|
|
results.data[results.data.length - 1].jwtId; |
|
|
|
|
|
if ( |
|
|
|
|
|
this.feedLastViewedId == null || |
|
|
|
|
|
this.feedLastViewedId < results.data[0].jwtId |
|
|
|
|
|
) { |
|
|
|
|
|
// save it to storage |
|
|
|
|
|
await db.open(); |
|
|
|
|
|
db.settings.update(MASTER_SETTINGS_KEY, { |
|
|
|
|
|
lastViewedClaimId: results.data[0].jwtId, |
|
|
|
|
|
}); |
|
|
|
|
|
// but not for this page because we need to remember what it was before |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
.catch((e) => { |
|
|
.catch((e) => { |
|
@ -190,7 +209,10 @@ export default class HomeView extends Vue { |
|
|
this.allAccounts |
|
|
this.allAccounts |
|
|
); |
|
|
); |
|
|
//console.log("about to parse from", this.activeDid, account?.identity); |
|
|
//console.log("about to parse from", this.activeDid, account?.identity); |
|
|
const identity = JSON.parse(account?.identity || "undefined"); |
|
|
const identity = JSON.parse(account?.identity || "null"); |
|
|
|
|
|
if (!identity) { |
|
|
|
|
|
throw new Error("No identity found."); |
|
|
|
|
|
} |
|
|
const token = await accessToken(identity); |
|
|
const token = await accessToken(identity); |
|
|
headers["Authorization"] = "Bearer " + token; |
|
|
headers["Authorization"] = "Bearer " + token; |
|
|
} else { |
|
|
} else { |
|
@ -278,7 +300,10 @@ export default class HomeView extends Vue { |
|
|
this.allAccounts |
|
|
this.allAccounts |
|
|
); |
|
|
); |
|
|
//console.log("about to parse from", this.activeDid, account?.identity); |
|
|
//console.log("about to parse from", this.activeDid, account?.identity); |
|
|
const identity = JSON.parse(account?.identity || "undefined"); |
|
|
const identity = JSON.parse(account?.identity || "null"); |
|
|
|
|
|
if (!identity) { |
|
|
|
|
|
throw new Error("No identity found."); |
|
|
|
|
|
} |
|
|
createAndSubmitGive( |
|
|
createAndSubmitGive( |
|
|
this.axios, |
|
|
this.axios, |
|
|
this.apiServer, |
|
|
this.apiServer, |
|
|