Browse Source

allow view of feed without an identifier

kb/add-usage-guide
Trent Larson 1 year ago
parent
commit
85bd807bcc
  1. 3
      project.task.yaml
  2. 1
      src/db/tables/settings.ts
  3. 2
      src/router/index.ts
  4. 25
      src/views/AccountViewView.vue
  5. 25
      src/views/HomeView.vue
  6. 2
      src/views/IdentitySwitcherView.vue

3
project.task.yaml

@ -6,11 +6,10 @@ tasks:
- 40 notifications :
- push, where we trigger a ServiceWorker(?) in the app to reach out and check for new data assignee:matthew
- .1 don't allow to even see the claim actions if they're not registered
- 01 Replace Gifted/Give in ContactsView with GiftedDialog assignee:matthew
- 01 fix the Discovery map display to not show on top of bottom icons (and any other UI tweaks on the map flow) assignee-group:ui
- .1 add instructions for map location selection
- 01 Show pop-up or some message confirming that settings & contacts download has been initiated/finished assignee:matthew assignee-group:ui

1
src/db/tables/settings.ts

@ -12,6 +12,7 @@ export type Settings = {
activeDid?: string;
apiServer?: string;
firstName?: string;
isRegistered?: boolean;
lastName?: string; // deprecated, pre v 0.1.3
lastViewedClaimId?: string;
searchBoxes?: Array<{

2
src/router/index.ts

@ -33,7 +33,6 @@ const routes: Array<RouteRecordRaw> = [
name: "home",
component: () =>
import(/* webpackChunkName: "home" */ "../views/HomeView.vue"),
beforeEnter: enterOrStart,
},
{
path: "/account",
@ -79,7 +78,6 @@ const routes: Array<RouteRecordRaw> = [
name: "contacts",
component: () =>
import(/* webpackChunkName: "contacts" */ "../views/ContactsView.vue"),
beforeEnter: enterOrStart,
},
{
path: "/scan-contact",

25
src/views/AccountViewView.vue

@ -166,7 +166,7 @@
</a>
<a ref="downloadLink" />
<div class="flex py-2">
<div v-if="activeDid" class="flex py-2">
<button class="text-center text-md text-blue-500" @click="checkLimits()">
Check Limits
</button>
@ -387,6 +387,7 @@ export default class AccountViewView extends Vue {
apiServerInput = "";
derivationPath = "";
givenName = "";
isRegistered = false;
numAccounts = 0;
publicHex = "";
publicBase64 = "";
@ -513,6 +514,7 @@ export default class AccountViewView extends Vue {
this.givenName =
(settings?.firstName || "") +
(settings?.lastName ? ` ${settings.lastName}` : ""); // pre v 0.1.3
this.isRegistered = !!settings?.isRegistered;
this.showContactGives = !!settings?.showContactGivesInline;
}
@ -699,6 +701,27 @@ export default class AccountViewView extends Vue {
const resp = await this.fetchRateLimits(identity);
if (resp.status === 200) {
this.limits = resp.data;
if (!this.isRegistered) {
// the user is not known to be registered, but they are so let's record it
try {
await db.open();
db.settings.update(MASTER_SETTINGS_KEY, {
isRegistered: true,
});
this.isRegistered = true;
} catch (err) {
console.log("Got an error updating settings:", err);
this.$notify(
{
group: "alert",
type: "warning",
title: "Update Error",
text: "Unable to update your settings. Check claim limits again.",
},
-1,
);
}
}
}
} catch (error) {
this.handleRateLimitsError(error);

25
src/views/HomeView.vue

@ -6,7 +6,29 @@
Time Safari
</h1>
<!-- show the actions for recognizing a give -->
<div class="mb-8">
<div v-if="!activeDid">
To record others' giving,
<router-link :to="{ name: 'start' }" class="text-blue-500">
create your identifier.</router-link
>
</div>
<div v-else-if="!isRegistered">
To record others' giving, someone must register your account, so show
them
<router-link :to="{ name: 'contact-qr' }" class="text-blue-500">
your identity info</router-link
>
and then
<router-link :to="{ name: 'account' }" class="text-blue-500">
check your limits.</router-link
>
</div>
<div v-else>
<!-- activeDid && isRegistered -->
<h2 class="text-xl font-bold">Record a Gift</h2>
<ul class="grid grid-cols-4 gap-x-3 gap-y-5 text-center mb-5">
@ -57,6 +79,7 @@
(No contacts to show.)
</div>
</div>
</div>
<GiftedDialog ref="customDialog" message="Received from"> </GiftedDialog>
@ -129,6 +152,7 @@ export default class HomeView extends Vue {
feedPreviousOldestId?: string;
feedLastViewedId?: string;
isHiddenSpinner = true;
isRegistered = false;
numAccounts = 0;
async beforeCreate() {
@ -173,6 +197,7 @@ export default class HomeView extends Vue {
this.activeDid = settings?.activeDid || "";
this.allContacts = await db.contacts.toArray();
this.feedLastViewedId = settings?.lastViewedClaimId;
this.isRegistered = !!settings?.isRegistered;
this.updateAllFeed();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (err: any) {

2
src/views/IdentitySwitcherView.vue

@ -151,7 +151,7 @@ export default class IdentitySwitcherView extends Vue {
did = undefined;
}
await db.open();
db.settings.update(MASTER_SETTINGS_KEY, {
await db.settings.update(MASTER_SETTINGS_KEY, {
activeDid: did,
});
this.activeDid = did || "";

Loading…
Cancel
Save