forked from trent_larson/crowd-funder-for-time-pwa
fix: debug and clean up GiftedPrompts contact retrieval logic
- Add comprehensive debug logging to identify contact list population issues - Fix array indexing bug in contact mapping (someContactDbIndex -> 0) - Clean up all console.log statements for production readiness - Improve contact retrieval debugging for SQLite and Dexie databases - Maintain core functionality while adding diagnostic capabilities Debugging: Contact list population issues in GiftedPrompts component Cleanup: Remove debug console.log statements
This commit is contained in:
@@ -227,6 +227,7 @@ export default class GivenPrompts extends Vue {
|
||||
|
||||
let someContactDbIndex = Math.floor(Math.random() * this.numContacts);
|
||||
let count = 0;
|
||||
|
||||
// as long as the index has an entry, loop
|
||||
while (
|
||||
this.shownContactDbIndices[someContactDbIndex] != null &&
|
||||
@@ -245,9 +246,8 @@ export default class GivenPrompts extends Vue {
|
||||
[someContactDbIndex],
|
||||
);
|
||||
if (result) {
|
||||
this.currentContact = databaseUtil.mapQueryResultToValues(result)[
|
||||
someContactDbIndex
|
||||
] as unknown as Contact;
|
||||
const mappedContacts = databaseUtil.mapQueryResultToValues(result);
|
||||
this.currentContact = mappedContacts[0] as unknown as Contact;
|
||||
}
|
||||
if (USE_DEXIE_DB) {
|
||||
await db.open();
|
||||
|
||||
Reference in New Issue
Block a user