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);
|
this.notify = createNotifyHelpers(this.$notify);
|
||||||
|
|
||||||
const settings = await this.$settings();
|
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 || "";
|
this.apiServer = settings.apiServer || "";
|
||||||
const pathParams = window.location.pathname.substring(
|
const pathParams = window.location.pathname.substring(
|
||||||
"/claim-cert/".length,
|
"/claim-cert/".length,
|
||||||
|
|||||||
@@ -547,7 +547,8 @@ export default class ConfirmGiftView extends Vue {
|
|||||||
*/
|
*/
|
||||||
private async initializeSettings() {
|
private async initializeSettings() {
|
||||||
const settings = await this.$accountSettings();
|
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.apiServer = settings.apiServer || "";
|
||||||
this.allContacts = await this.$getAllContacts();
|
this.allContacts = await this.$getAllContacts();
|
||||||
this.isRegistered = settings.isRegistered || false;
|
this.isRegistered = settings.isRegistered || false;
|
||||||
|
|||||||
@@ -679,7 +679,9 @@ export default class HelpView extends Vue {
|
|||||||
try {
|
try {
|
||||||
const settings = await this.$accountSettings();
|
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({
|
await this.$updateSettings({
|
||||||
...settings,
|
...settings,
|
||||||
finishedOnboarding: false,
|
finishedOnboarding: false,
|
||||||
@@ -687,7 +689,7 @@ export default class HelpView extends Vue {
|
|||||||
|
|
||||||
this.$log(
|
this.$log(
|
||||||
"[HelpView] Onboarding reset successfully for DID: " +
|
"[HelpView] Onboarding reset successfully for DID: " +
|
||||||
settings.activeDid,
|
activeDid,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,11 +207,12 @@ export default class ImportAccountView extends Vue {
|
|||||||
// Check what was actually imported
|
// Check what was actually imported
|
||||||
const settings = await this.$accountSettings();
|
const settings = await this.$accountSettings();
|
||||||
|
|
||||||
// Check account-specific settings
|
// Check account-specific settings using Active Identity façade
|
||||||
if (settings?.activeDid) {
|
const activeDid = await this.$getActiveDid();
|
||||||
|
if (activeDid) {
|
||||||
try {
|
try {
|
||||||
await this.$query("SELECT * FROM settings WHERE accountDid = ?", [
|
await this.$query("SELECT * FROM settings WHERE accountDid = ?", [
|
||||||
settings.activeDid,
|
activeDid,
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Log error but don't interrupt import flow
|
// Log error but don't interrupt import flow
|
||||||
|
|||||||
@@ -541,7 +541,8 @@ export default class Help extends Vue {
|
|||||||
*/
|
*/
|
||||||
async mounted() {
|
async mounted() {
|
||||||
const settings = await this.$accountSettings();
|
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.apiServer = settings.apiServer || "";
|
||||||
this.userName = settings.firstName;
|
this.userName = settings.firstName;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user