feat: migrate batch 4 components to active identity façade
- Update HelpView, ConfirmGiftView, TestView, ClaimReportCertificateView - Update ImportAccountView with conditional activeDid check - Replace settings.activeDid with () façade method - Add consistent migration comments for future reference Batch 4 completes migration of 5 additional medium-priority components with various usage patterns.
This commit is contained in:
@@ -54,7 +54,8 @@ export default class ClaimReportCertificateView extends Vue {
|
||||
this.notify = createNotifyHelpers(this.$notify);
|
||||
|
||||
const settings = await this.$settings();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
// Use new Active Identity façade instead of settings.activeDid
|
||||
this.activeDid = (await this.$getActiveDid()) || "";
|
||||
this.apiServer = settings.apiServer || "";
|
||||
const pathParams = window.location.pathname.substring(
|
||||
"/claim-cert/".length,
|
||||
|
||||
@@ -547,7 +547,8 @@ export default class ConfirmGiftView extends Vue {
|
||||
*/
|
||||
private async initializeSettings() {
|
||||
const settings = await this.$accountSettings();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
// Use new Active Identity façade instead of settings.activeDid
|
||||
this.activeDid = (await this.$getActiveDid()) || "";
|
||||
this.apiServer = settings.apiServer || "";
|
||||
this.allContacts = await this.$getAllContacts();
|
||||
this.isRegistered = settings.isRegistered || false;
|
||||
|
||||
@@ -679,7 +679,9 @@ export default class HelpView extends Vue {
|
||||
try {
|
||||
const settings = await this.$accountSettings();
|
||||
|
||||
if (settings.activeDid) {
|
||||
// Use new Active Identity façade instead of settings.activeDid
|
||||
const activeDid = await this.$getActiveDid();
|
||||
if (activeDid) {
|
||||
await this.$updateSettings({
|
||||
...settings,
|
||||
finishedOnboarding: false,
|
||||
@@ -687,7 +689,7 @@ export default class HelpView extends Vue {
|
||||
|
||||
this.$log(
|
||||
"[HelpView] Onboarding reset successfully for DID: " +
|
||||
settings.activeDid,
|
||||
activeDid,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -207,11 +207,12 @@ export default class ImportAccountView extends Vue {
|
||||
// Check what was actually imported
|
||||
const settings = await this.$accountSettings();
|
||||
|
||||
// Check account-specific settings
|
||||
if (settings?.activeDid) {
|
||||
// Check account-specific settings using Active Identity façade
|
||||
const activeDid = await this.$getActiveDid();
|
||||
if (activeDid) {
|
||||
try {
|
||||
await this.$query("SELECT * FROM settings WHERE accountDid = ?", [
|
||||
settings.activeDid,
|
||||
activeDid,
|
||||
]);
|
||||
} catch (error) {
|
||||
// Log error but don't interrupt import flow
|
||||
|
||||
@@ -541,7 +541,8 @@ export default class Help extends Vue {
|
||||
*/
|
||||
async mounted() {
|
||||
const settings = await this.$accountSettings();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
// Use new Active Identity façade instead of settings.activeDid
|
||||
this.activeDid = (await this.$getActiveDid()) || "";
|
||||
this.apiServer = settings.apiServer || "";
|
||||
this.userName = settings.firstName;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user