forked from jsnbuchanan/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 someContactDbIndex = Math.floor(Math.random() * this.numContacts);
|
||||||
let count = 0;
|
let count = 0;
|
||||||
|
|
||||||
// as long as the index has an entry, loop
|
// as long as the index has an entry, loop
|
||||||
while (
|
while (
|
||||||
this.shownContactDbIndices[someContactDbIndex] != null &&
|
this.shownContactDbIndices[someContactDbIndex] != null &&
|
||||||
@@ -245,9 +246,8 @@ export default class GivenPrompts extends Vue {
|
|||||||
[someContactDbIndex],
|
[someContactDbIndex],
|
||||||
);
|
);
|
||||||
if (result) {
|
if (result) {
|
||||||
this.currentContact = databaseUtil.mapQueryResultToValues(result)[
|
const mappedContacts = databaseUtil.mapQueryResultToValues(result);
|
||||||
someContactDbIndex
|
this.currentContact = mappedContacts[0] as unknown as Contact;
|
||||||
] as unknown as Contact;
|
|
||||||
}
|
}
|
||||||
if (USE_DEXIE_DB) {
|
if (USE_DEXIE_DB) {
|
||||||
await db.open();
|
await db.open();
|
||||||
|
|||||||
Reference in New Issue
Block a user