Browse Source

tweak messages for missing identifier

starred-projects
Trent Larson 10 months ago
parent
commit
2e164dfeff
  1. 6
      README.md
  2. 29
      src/views/AccountViewView.vue

6
README.md

@ -30,7 +30,7 @@ npm run lint
... though maybe you do that after testing and release, since that isn't used in the build (and you often increment a lot during testing). ... though maybe you do that after testing and release, since that isn't used in the build (and you often increment a lot during testing).
* If production, change src/constants/app.ts DEFAULT_*_SERVER to be "PROD" and package.json to remove "_Test". Also record what version is on production. * If production: change src/constants/app.ts DEFAULT_*_SERVER to be "PROD" and package.json to remove "_Test". Also record what version is on production.
* `npm run build` * `npm run build`
@ -77,10 +77,10 @@ To add an icon, add to main.ts and reference with `fa` element and `icon` attrib
### Manual walk-through test ### Manual walk-through test
- If there were any DB changes, check that you're on the old version and reload the page and ensure you can still act. - If there were any DB changes, check that you're on the old version and reload the page and ensure you can still act.
- Check that the version is updated.
- Use a mobile user as well as a desktop user. - Use a mobile user as well as a desktop user.
- Backup seed & data & get a CSV dump from Endorser Mobile. - Backup seed & data & get a CSV dump from Endorser Mobile.
- Clear the browser data & Time Safari contacts and then CSV contacts. - Check that the version is updated.
- Clear the browser data & import Time Safari contacts and then CSV contacts.
- Clear the browser data again. (See "Reset" below.) Make sure that it's using the test API (under Identity in 'Advanced'). - Clear the browser data again. (See "Reset" below.) Make sure that it's using the test API (under Identity in 'Advanced').
- Go to the account page before visiting the home page to see that there is no ID. - Go to the account page before visiting the home page to see that there is no ID.
- On the home page: - On the home page:

29
src/views/AccountViewView.vue

@ -527,14 +527,13 @@ export default class AccountViewView extends Vue {
isRegistered = false; isRegistered = false;
isSubscribed = false; isSubscribed = false;
notificationMaybeChanged = false; notificationMaybeChanged = false;
numAccounts = 0;
publicHex = ""; publicHex = "";
publicBase64 = ""; publicBase64 = "";
webPushServer = ""; webPushServer = "";
webPushServerInput = ""; webPushServerInput = "";
limits: RateLimits | null = null; limits: RateLimits | null = null;
limitsMessage = ""; limitsMessage = "";
loadingLimits = true; // might as well now that we do it on mount, to avoid flashing the registration message loadingLimits = false;
showContactGives = false; showContactGives = false;
showDidCopy = false; showDidCopy = false;
showDerCopy = false; showDerCopy = false;
@ -545,11 +544,6 @@ export default class AccountViewView extends Vue {
warnIfProdServer = false; warnIfProdServer = false;
warnIfTestServer = false; warnIfTestServer = false;
async beforeCreate() {
await accountsDB.open();
this.numAccounts = await accountsDB.accounts.count();
}
/** /**
* Async function executed when the component is created. * Async function executed when the component is created.
* Initializes the component's state with values from the database, * Initializes the component's state with values from the database,
@ -741,18 +735,17 @@ export default class AccountViewView extends Vue {
"Attempted to load account records with no identifier available." "Attempted to load account records with no identifier available."
) { ) {
this.limitsMessage = "No identifier."; this.limitsMessage = "No identifier.";
this.loadingLimits = false;
} else { } else {
console.error("Telling user to clear cache at page create because:", err);
this.$notify( this.$notify(
{ {
group: "alert", group: "alert",
type: "danger", type: "danger",
title: "Error Creating Account", title: "Error Loading Account",
text: "Clear your cache and start over (after data backup).", text: "Clear your cache and start over (after data backup).",
}, },
-1, -1,
); );
console.error("Telling user to clear cache at page create because:", err);
} }
} }
@ -961,6 +954,18 @@ export default class AccountViewView extends Vue {
console.log( console.log(
`Import progress: ${progress.completedRows} of ${progress.totalRows} rows completed.`, `Import progress: ${progress.completedRows} of ${progress.totalRows} rows completed.`,
); );
if (progress.done) {
console.log(`Imported ${progress.completedTables} tables.`);
this.$notify(
{
group: "alert",
type: "success",
title: "Import Complete",
text: "",
},
5000,
);
}
return true; return true;
} }
@ -968,6 +973,8 @@ export default class AccountViewView extends Vue {
const identity = await this.getIdentity(this.activeDid); const identity = await this.getIdentity(this.activeDid);
if (identity) { if (identity) {
this.checkLimitsFor(identity); this.checkLimitsFor(identity);
} else {
this.limitsMessage = "You have no identifier.";
} }
} }
@ -1044,7 +1051,7 @@ export default class AccountViewView extends Vue {
error.message === error.message ===
"Attempted to load Give records with no identifier available." "Attempted to load Give records with no identifier available."
) { ) {
this.limitsMessage = "No identifier."; this.limitsMessage = "You have no identifier.";
} else { } else {
// Handle other unknown errors // Handle other unknown errors
} }

Loading…
Cancel
Save