forked from jsnbuchanan/crowd-funder-for-time-pwa
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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 || "";
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user