forked from trent_larson/crowd-funder-for-time-pwa
migrate: PhotoDialog.vue to use () API
- Replace settings.activeDid with () pattern - Maintains backward compatibility with existing functionality - Component now uses active_identity table as single source of truth - Part of ActiveDid migration (2/32 components completed) - Updated migration plan to include lint-fix step
This commit is contained in:
@@ -445,12 +445,32 @@ async function rollbackActiveDidMigration(): Promise<boolean> {
|
||||
| **Start application in browser** | Application loads and initializes IndexedDB database | ✅ COMPLETE |
|
||||
| **Inspect IndexedDB via DevTools** | Verify active_identity table exists and contains data | ✅ COMPLETE |
|
||||
| **Update first component** | One component successfully uses new API pattern | ✅ COMPLETE (HomeView.vue) |
|
||||
| **Systematic component updates** | All 32 remaining components use new API pattern | 🟢 HIGH |
|
||||
| **Systematic component updates** | All 32 remaining components use new API pattern (with test:web after each) | 🟢 HIGH |
|
||||
| **Test all platforms** | Web, Electron, iOS, Android platforms verified working | 🟡 MEDIUM |
|
||||
| **Performance optimization** | Reduce excessive $getActiveIdentity() calls | 🟡 MEDIUM |
|
||||
|
||||
**Critical Blocker**: API layer complete. Ready to proceed with component updates.
|
||||
|
||||
## Migration Execution Rule
|
||||
|
||||
### **One Component + Test Pattern**
|
||||
**Rule**: After migrating each component, run `npm run test:web` and `npm run lint-fix` to verify the change doesn't break existing functionality and meets code standards.
|
||||
|
||||
**Workflow**:
|
||||
1. **Migrate one component** - Update to use `$getActiveIdentity()` pattern
|
||||
2. **Run lint-fix** - Ensure code meets project standards
|
||||
3. **Run test:web** - Verify no regressions introduced
|
||||
4. **Commit if passing** - Only commit after tests and linting pass
|
||||
5. **Repeat** - Move to next component
|
||||
|
||||
**Benefits**:
|
||||
- Catch issues immediately after each change
|
||||
- Maintain code quality throughout migration
|
||||
- Easy rollback if problems arise
|
||||
- Systematic progress tracking
|
||||
|
||||
**Exit Criteria**: All 32 components migrated with passing tests
|
||||
|
||||
## Performance Observations
|
||||
|
||||
### Excessive API Calls Detected
|
||||
|
||||
@@ -268,7 +268,11 @@ export default class PhotoDialog extends Vue {
|
||||
// logger.log("PhotoDialog mounted");
|
||||
try {
|
||||
const settings = await this.$accountSettings();
|
||||
this.activeDid = settings.activeDid || "";
|
||||
|
||||
// Get activeDid from active_identity table (single source of truth)
|
||||
const activeIdentity = await this.$getActiveIdentity();
|
||||
this.activeDid = activeIdentity.activeDid || "";
|
||||
|
||||
this.isRegistered = !!settings.isRegistered;
|
||||
logger.log("isRegistered:", this.isRegistered);
|
||||
} catch (error: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user