From 3233150cc44f7bf25abc5755e953148e01d516df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Wed, 19 Aug 2026 12:24:50 -0600 Subject: [PATCH] Connect Nostr account from My Contributions And upon connection, immediately fetch contributions and render them --- app/components/contributions-timeline.gjs | 116 ++++++++++++++-------- app/controllers/contributions.js | 5 + app/templates/contributions.gjs | 1 + 3 files changed, 83 insertions(+), 39 deletions(-) diff --git a/app/components/contributions-timeline.gjs b/app/components/contributions-timeline.gjs index ecc2eff..72e5ef0 100644 --- a/app/components/contributions-timeline.gjs +++ b/app/components/contributions-timeline.gjs @@ -1,48 +1,86 @@ +import Component from '@glimmer/component'; +import { action } from '@ember/object'; +import { tracked } from '@glimmer/tracking'; import { on } from '@ember/modifier'; import Icon from './icon'; import ContributionPhoto from './contribution-photo'; +import Modal from './modal'; +import NostrConnect from './nostr-connect'; import eq from 'ember-truth-helpers/helpers/eq'; import not from 'ember-truth-helpers/helpers/not'; import restoreScroll from '../modifiers/restore-scroll'; - +} diff --git a/app/controllers/contributions.js b/app/controllers/contributions.js index 38a0a44..15909e2 100644 --- a/app/controllers/contributions.js +++ b/app/controllers/contributions.js @@ -43,6 +43,11 @@ export default class ContributionsController extends Controller { this.router.transitionTo(`/place/${item.placeIdentifier}`); } + @action + onNostrConnected() { + this.loadContributionsTask.perform(this.nostrAuth.pubkey); + } + @action backToMenu() { this.router.transitionTo('menu'); diff --git a/app/templates/contributions.gjs b/app/templates/contributions.gjs index bcf6c2a..cfa5398 100644 --- a/app/templates/contributions.gjs +++ b/app/templates/contributions.gjs @@ -10,6 +10,7 @@ import ContributionsTimeline from '#components/contributions-timeline'; @onSelect={{@controller.selectContribution}} @onBack={{@controller.backToMenu}} @onClose={{@controller.close}} + @onNostrConnected={{@controller.onNostrConnected}} /> {{/if}}