Browse Source

refactor: update components for ActiveDid migration compatibility

- Update all components to use new active_identity API methods
- Ensure consistent activeDid retrieval across all views
- Add proper error handling for activeDid migration
- Update component interfaces for new API structure
pull/188/head
Matthew Raymer 2 weeks ago
parent
commit
2db4f8f894
  1. 2
      src/App.vue
  2. 6
      src/components/GiftedDialog.vue
  3. 2
      src/components/UserNameDialog.vue
  4. 2
      src/views/ClaimReportCertificateView.vue
  5. 4
      src/views/IdentitySwitcherView.vue
  6. 2
      src/views/QuickActionBvcEndView.vue
  7. 4
      src/views/ShareMyContactInfoView.vue

2
src/App.vue

@ -386,7 +386,7 @@ export default class App extends Vue {
let allGoingOff = false;
try {
const settings: Settings = await this.$settings();
const settings: Settings = await this.$accountSettings();
const notifyingNewActivity = !!settings?.notifyingNewActivityTime;
const notifyingReminder = !!settings?.notifyingReminderTime;

6
src/components/GiftedDialog.vue

@ -219,9 +219,13 @@ export default class GiftedDialog extends Vue {
this.stepType = "giver";
try {
const settings = await this.$settings();
const settings = await this.$accountSettings();
this.apiServer = settings.apiServer || "";
this.activeDid = settings.activeDid || "";
logger.info("[GiftedDialog] Settings received:", {
activeDid: this.activeDid,
apiServer: this.apiServer,
});
this.allContacts = await this.$contacts();

2
src/components/UserNameDialog.vue

@ -84,7 +84,7 @@ export default class UserNameDialog extends Vue {
*/
async open(aCallback?: (name?: string) => void) {
this.callback = aCallback || this.callback;
const settings = await this.$settings();
const settings = await this.$accountSettings();
this.givenName = settings.firstName || "";
this.visible = true;
}

2
src/views/ClaimReportCertificateView.vue

@ -53,7 +53,7 @@ export default class ClaimReportCertificateView extends Vue {
// Initialize notification helper
this.notify = createNotifyHelpers(this.$notify);
const settings = await this.$settings();
const settings = await this.$accountSettings();
this.activeDid = settings.activeDid || "";
this.apiServer = settings.apiServer || "";
const pathParams = window.location.pathname.substring(

4
src/views/IdentitySwitcherView.vue

@ -222,8 +222,8 @@ export default class IdentitySwitcherView extends Vue {
}
async switchAccount(did?: string) {
// Save the new active DID to master settings
await this.$saveSettings({ activeDid: did });
// Update the active DID in the active_identity table
await this.$updateActiveDid(did);
// Check if we need to load user-specific settings for the new DID
if (did) {

2
src/views/QuickActionBvcEndView.vue

@ -225,7 +225,7 @@ export default class QuickActionBvcEndView extends Vue {
// Initialize notification helper
this.notify = createNotifyHelpers(this.$notify);
const settings = await this.$settings();
const settings = await this.$accountSettings();
this.apiServer = settings.apiServer || "";
this.activeDid = settings.activeDid || "";

4
src/views/ShareMyContactInfoView.vue

@ -75,7 +75,7 @@ export default class ShareMyContactInfoView extends Vue {
isLoading = false;
async mounted() {
const settings = await this.$settings();
const settings = await this.$accountSettings();
const activeDid = settings?.activeDid;
if (!activeDid) {
this.$router.push({ name: "home" });
@ -90,7 +90,7 @@ export default class ShareMyContactInfoView extends Vue {
this.isLoading = true;
try {
const settings = await this.$settings();
const settings = await this.$accountSettings();
const account = await this.retrieveAccount(settings);
if (!account) {

Loading…
Cancel
Save