diff --git a/src/components/DataExportSection.vue b/src/components/DataExportSection.vue
index ce8ee2fc..a21be7b2 100644
--- a/src/components/DataExportSection.vue
+++ b/src/components/DataExportSection.vue
@@ -187,9 +187,10 @@ export default class DataExportSection extends Vue {
const exContact: Contact = R.omit(["contactMethods"], contact);
// now add contactMethods as a true array of ContactMethod objects
exContact.contactMethods = contact.contactMethods
- ? (typeof contact.contactMethods === 'string' && contact.contactMethods.trim() !== ''
- ? JSON.parse(contact.contactMethods)
- : [])
+ ? typeof contact.contactMethods === "string" &&
+ contact.contactMethods.trim() !== ""
+ ? JSON.parse(contact.contactMethods)
+ : []
: [];
return exContact;
});
diff --git a/src/components/FeedFilters.vue b/src/components/FeedFilters.vue
index e0ab2f9e..b188ebfe 100644
--- a/src/components/FeedFilters.vue
+++ b/src/components/FeedFilters.vue
@@ -119,11 +119,13 @@ export default class FeedFilters extends Vue {
isNearby = false;
settingChanged = false;
visible = false;
+ activeDid = "";
- async open(onCloseIfChanged: () => void) {
+ async open(onCloseIfChanged: () => void, activeDid: string) {
this.onCloseIfChanged = onCloseIfChanged;
+ this.activeDid = activeDid;
- const settings = await this.$settings();
+ const settings = await this.$accountSettings(activeDid);
this.hasVisibleDid = !!settings.filterFeedByVisible;
this.isNearby = !!settings.filterFeedByNearby;
if (settings.searchBoxes && settings.searchBoxes.length > 0) {
@@ -137,17 +139,45 @@ export default class FeedFilters extends Vue {
async toggleHasVisibleDid() {
this.settingChanged = true;
this.hasVisibleDid = !this.hasVisibleDid;
- await this.$updateSettings({
- filterFeedByVisible: this.hasVisibleDid,
- });
+
+ if (this.activeDid) {
+ await this.$updateSettings(
+ {
+ filterFeedByVisible: this.hasVisibleDid,
+ },
+ this.activeDid,
+ );
+ } else {
+ await this.$updateSettings({
+ filterFeedByVisible: this.hasVisibleDid,
+ });
+ }
}
async toggleNearby() {
this.settingChanged = true;
this.isNearby = !this.isNearby;
- await this.$updateSettings({
- filterFeedByNearby: this.isNearby,
+
+ console.log("[FeedFilters] ๐ Toggling nearby filter:", {
+ newValue: this.isNearby,
+ settingChanged: this.settingChanged,
+ activeDid: this.activeDid,
});
+
+ if (this.activeDid) {
+ await this.$updateSettings(
+ {
+ filterFeedByNearby: this.isNearby,
+ },
+ this.activeDid,
+ );
+ } else {
+ await this.$updateSettings({
+ filterFeedByNearby: this.isNearby,
+ });
+ }
+
+ console.log("[FeedFilters] โ
Nearby filter updated in settings");
}
async clearAll() {
@@ -155,10 +185,20 @@ export default class FeedFilters extends Vue {
this.settingChanged = true;
}
- await this.$updateSettings({
- filterFeedByNearby: false,
- filterFeedByVisible: false,
- });
+ if (this.activeDid) {
+ await this.$updateSettings(
+ {
+ filterFeedByNearby: false,
+ filterFeedByVisible: false,
+ },
+ this.activeDid,
+ );
+ } else {
+ await this.$updateSettings({
+ filterFeedByNearby: false,
+ filterFeedByVisible: false,
+ });
+ }
this.hasVisibleDid = false;
this.isNearby = false;
@@ -169,23 +209,40 @@ export default class FeedFilters extends Vue {
this.settingChanged = true;
}
- await this.$updateSettings({
- filterFeedByNearby: true,
- filterFeedByVisible: true,
- });
+ if (this.activeDid) {
+ await this.$updateSettings(
+ {
+ filterFeedByNearby: true,
+ filterFeedByVisible: true,
+ },
+ this.activeDid,
+ );
+ } else {
+ await this.$updateSettings({
+ filterFeedByNearby: true,
+ filterFeedByVisible: true,
+ });
+ }
this.hasVisibleDid = true;
this.isNearby = true;
}
close() {
+ console.log("[FeedFilters] ๐ช Closing dialog:", {
+ settingChanged: this.settingChanged,
+ hasCallback: !!this.onCloseIfChanged,
+ });
+
if (this.settingChanged) {
+ console.log("[FeedFilters] ๐ Settings changed, calling callback");
this.onCloseIfChanged();
}
this.visible = false;
}
done() {
+ console.log("[FeedFilters] โ
Done button clicked");
this.close();
}
}
diff --git a/src/components/OfferDialog.vue b/src/components/OfferDialog.vue
index b8b8093f..81664088 100644
--- a/src/components/OfferDialog.vue
+++ b/src/components/OfferDialog.vue
@@ -18,7 +18,7 @@ Raymer */
@@ -152,8 +152,6 @@ export default class OfferDialog extends Vue {
};
}
-
-
// =================================================
// COMPONENT METHODS
// =================================================
@@ -199,8 +197,6 @@ export default class OfferDialog extends Vue {
this.visible = false;
}
-
-
/**
* Handle amount updates from AmountInput component
* @param value - New amount value
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue
index 25bcac3e..98463ae3 100644
--- a/src/views/HomeView.vue
+++ b/src/views/HomeView.vue
@@ -763,17 +763,34 @@ export default class HomeView extends Vue {
* Called by FeedFilters component when filters change
*/
async reloadFeedOnChange() {
- const settings = await this.$accountSettings(this.activeDid, {
- filterFeedByVisible: false,
- filterFeedByNearby: false,
+ logger.info("[HomeView] ๐ reloadFeedOnChange() called - refreshing feed");
+
+ // Get current settings without overriding with defaults
+ const settings = await this.$accountSettings(this.activeDid);
+
+ logger.info("[HomeView] ๐ Current filter settings:", {
+ filterFeedByVisible: settings.filterFeedByVisible,
+ filterFeedByNearby: settings.filterFeedByNearby,
+ searchBoxes: settings.searchBoxes?.length || 0,
});
+
this.isFeedFilteredByVisible = !!settings.filterFeedByVisible;
this.isFeedFilteredByNearby = !!settings.filterFeedByNearby;
this.isAnyFeedFilterOn = checkIsAnyFeedFilterOn(settings);
+ logger.info("[HomeView] ๐ฏ Updated filter states:", {
+ isFeedFilteredByVisible: this.isFeedFilteredByVisible,
+ isFeedFilteredByNearby: this.isFeedFilteredByNearby,
+ isAnyFeedFilterOn: this.isAnyFeedFilterOn,
+ });
+
this.feedData = [];
this.feedPreviousOldestId = undefined;
+
+ logger.info("[HomeView] ๐งน Cleared feed data, calling updateAllFeed()");
await this.updateAllFeed();
+
+ logger.info("[HomeView] โ
Feed refresh completed");
}
/**
@@ -852,6 +869,14 @@ export default class HomeView extends Vue {
* - this.feedLastViewedClaimId (via updateFeedLastViewedId)
*/
async updateAllFeed() {
+ logger.info("[HomeView] ๐ updateAllFeed() called", {
+ isFeedLoading: this.isFeedLoading,
+ currentFeedDataLength: this.feedData.length,
+ isAnyFeedFilterOn: this.isAnyFeedFilterOn,
+ isFeedFilteredByVisible: this.isFeedFilteredByVisible,
+ isFeedFilteredByNearby: this.isFeedFilteredByNearby,
+ });
+
this.isFeedLoading = true;
let endOfResults = true;
@@ -860,21 +885,37 @@ export default class HomeView extends Vue {
this.apiServer,
this.feedPreviousOldestId,
);
+
+ logger.info("[HomeView] ๐ก Retrieved gives from API", {
+ resultsCount: results.data.length,
+ endOfResults,
+ });
+
if (results.data.length > 0) {
endOfResults = false;
// gather any contacts that user has blocked from view
await this.processFeedResults(results.data);
await this.updateFeedLastViewedId(results.data);
+
+ logger.info("[HomeView] ๐ Processed feed results", {
+ processedCount: this.feedData.length,
+ });
}
} catch (e) {
+ logger.error("[HomeView] โ Error in updateAllFeed:", e);
this.handleFeedError(e);
}
if (this.feedData.length === 0 && !endOfResults) {
+ logger.info("[HomeView] ๐ No results after filtering, retrying...");
await this.updateAllFeed();
}
this.isFeedLoading = false;
+ logger.info("[HomeView] โ
updateAllFeed() completed", {
+ finalFeedDataLength: this.feedData.length,
+ isFeedLoading: this.isFeedLoading,
+ });
}
/**
@@ -899,12 +940,35 @@ export default class HomeView extends Vue {
* @param records Array of feed records to process
*/
private async processFeedResults(records: GiveSummaryRecord[]) {
+ logger.info("[HomeView] ๐ Processing feed results:", {
+ inputRecords: records.length,
+ currentFilters: {
+ isAnyFeedFilterOn: this.isAnyFeedFilterOn,
+ isFeedFilteredByVisible: this.isFeedFilteredByVisible,
+ isFeedFilteredByNearby: this.isFeedFilteredByNearby,
+ },
+ });
+
+ let processedCount = 0;
+ let filteredCount = 0;
+
for (const record of records) {
const processedRecord = await this.processRecord(record);
if (processedRecord) {
this.feedData.push(processedRecord);
+ processedCount++;
+ } else {
+ filteredCount++;
}
}
+
+ logger.info("[HomeView] ๐ Feed processing results:", {
+ processed: processedCount,
+ filtered: filteredCount,
+ total: records.length,
+ finalFeedLength: this.feedData.length,
+ });
+
this.feedPreviousOldestId = records[records.length - 1].jwtId;
}
@@ -938,7 +1002,7 @@ export default class HomeView extends Vue {
* - this.feedData (via createFeedRecord)
*
* @param record The record to process
- * @returns Processed record with contact info if it passes filters, null otherwise
+ * @returns Processed record if it passes filters, null otherwise
*/
private async processRecord(
record: GiveSummaryRecord,
@@ -948,13 +1012,28 @@ export default class HomeView extends Vue {
const recipientDid = this.extractRecipientDid(claim);
const fulfillsPlan = await this.getFulfillsPlan(record);
+
+ // Log record details for debugging
+ logger.debug("[HomeView] ๐ Processing record:", {
+ recordId: record.jwtId,
+ hasFulfillsPlan: !!fulfillsPlan,
+ fulfillsPlanHandleId: record.fulfillsPlanHandleId,
+ filters: {
+ isAnyFeedFilterOn: this.isAnyFeedFilterOn,
+ isFeedFilteredByVisible: this.isFeedFilteredByNearby,
+ isFeedFilteredByNearby: this.isFeedFilteredByNearby,
+ },
+ });
+
if (!this.shouldIncludeRecord(record, fulfillsPlan)) {
+ logger.debug("[HomeView] โ Record filtered out:", record.jwtId);
return null;
}
const provider = this.extractProvider(claim);
const providedByPlan = await this.getProvidedByPlan(provider);
+ logger.debug("[HomeView] โ
Record included:", record.jwtId);
return this.createFeedRecord(
record,
claim,
@@ -1103,6 +1182,22 @@ export default class HomeView extends Vue {
}
}
+ // Add debug logging for nearby filter
+ if (this.isFeedFilteredByNearby && record.fulfillsPlanHandleId) {
+ logger.debug("[HomeView] ๐ Nearby filter check:", {
+ recordId: record.jwtId,
+ hasFulfillsPlan: !!fulfillsPlan,
+ hasLocation: !!(fulfillsPlan?.locLat && fulfillsPlan?.locLon),
+ location: fulfillsPlan
+ ? { lat: fulfillsPlan.locLat, lon: fulfillsPlan.locLon }
+ : null,
+ inSearchBox: fulfillsPlan
+ ? this.latLongInAnySearchBox(fulfillsPlan.locLat, fulfillsPlan.locLon)
+ : null,
+ finalResult: anyMatch,
+ });
+ }
+
return anyMatch;
}
@@ -1538,7 +1633,10 @@ export default class HomeView extends Vue {
* Called by template click handler
*/
openFeedFilters() {
- (this.$refs.feedFilters as FeedFilters).open(this.reloadFeedOnChange);
+ (this.$refs.feedFilters as FeedFilters).open(
+ this.reloadFeedOnChange,
+ this.activeDid,
+ );
}
/**