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;
|
let allGoingOff = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const settings: Settings = await this.$settings();
|
const settings: Settings = await this.$accountSettings();
|
||||||
|
|
||||||
const notifyingNewActivity = !!settings?.notifyingNewActivityTime;
|
const notifyingNewActivity = !!settings?.notifyingNewActivityTime;
|
||||||
const notifyingReminder = !!settings?.notifyingReminderTime;
|
const notifyingReminder = !!settings?.notifyingReminderTime;
|
||||||
|
|||||||
@@ -219,9 +219,13 @@ export default class GiftedDialog extends Vue {
|
|||||||
this.stepType = "giver";
|
this.stepType = "giver";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
this.apiServer = settings.apiServer || "";
|
this.apiServer = settings.apiServer || "";
|
||||||
this.activeDid = settings.activeDid || "";
|
this.activeDid = settings.activeDid || "";
|
||||||
|
logger.info("[GiftedDialog] Settings received:", {
|
||||||
|
activeDid: this.activeDid,
|
||||||
|
apiServer: this.apiServer,
|
||||||
|
});
|
||||||
|
|
||||||
this.allContacts = await this.$contacts();
|
this.allContacts = await this.$contacts();
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ export default class UserNameDialog extends Vue {
|
|||||||
*/
|
*/
|
||||||
async open(aCallback?: (name?: string) => void) {
|
async open(aCallback?: (name?: string) => void) {
|
||||||
this.callback = aCallback || this.callback;
|
this.callback = aCallback || this.callback;
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
this.givenName = settings.firstName || "";
|
this.givenName = settings.firstName || "";
|
||||||
this.visible = true;
|
this.visible = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ export default class ClaimReportCertificateView extends Vue {
|
|||||||
// Initialize notification helper
|
// Initialize notification helper
|
||||||
this.notify = createNotifyHelpers(this.$notify);
|
this.notify = createNotifyHelpers(this.$notify);
|
||||||
|
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
this.activeDid = settings.activeDid || "";
|
this.activeDid = settings.activeDid || "";
|
||||||
this.apiServer = settings.apiServer || "";
|
this.apiServer = settings.apiServer || "";
|
||||||
const pathParams = window.location.pathname.substring(
|
const pathParams = window.location.pathname.substring(
|
||||||
|
|||||||
@@ -222,8 +222,8 @@ export default class IdentitySwitcherView extends Vue {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async switchAccount(did?: string) {
|
async switchAccount(did?: string) {
|
||||||
// Save the new active DID to master settings
|
// Update the active DID in the active_identity table
|
||||||
await this.$saveSettings({ activeDid: did });
|
await this.$updateActiveDid(did);
|
||||||
|
|
||||||
// Check if we need to load user-specific settings for the new DID
|
// Check if we need to load user-specific settings for the new DID
|
||||||
if (did) {
|
if (did) {
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ export default class QuickActionBvcEndView extends Vue {
|
|||||||
// Initialize notification helper
|
// Initialize notification helper
|
||||||
this.notify = createNotifyHelpers(this.$notify);
|
this.notify = createNotifyHelpers(this.$notify);
|
||||||
|
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
this.apiServer = settings.apiServer || "";
|
this.apiServer = settings.apiServer || "";
|
||||||
this.activeDid = settings.activeDid || "";
|
this.activeDid = settings.activeDid || "";
|
||||||
|
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ export default class ShareMyContactInfoView extends Vue {
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
|
|
||||||
async mounted() {
|
async mounted() {
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
const activeDid = settings?.activeDid;
|
const activeDid = settings?.activeDid;
|
||||||
if (!activeDid) {
|
if (!activeDid) {
|
||||||
this.$router.push({ name: "home" });
|
this.$router.push({ name: "home" });
|
||||||
@@ -90,7 +90,7 @@ export default class ShareMyContactInfoView extends Vue {
|
|||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const settings = await this.$settings();
|
const settings = await this.$accountSettings();
|
||||||
const account = await this.retrieveAccount(settings);
|
const account = await this.retrieveAccount(settings);
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
|
|||||||
Reference in New Issue
Block a user