From f980d26ccd8525f576d55fb62486b0914951a6eb Mon Sep 17 00:00:00 2001 From: vivganes Date: Sat, 27 Jan 2024 19:12:53 +0530 Subject: [PATCH] add ability to refresh feed --- src/app/app.component.ts | 6 +++-- .../event-feed/event-feed.component.html | 27 ++++++++++++++----- .../event-feed/event-feed.component.ts | 4 +++ src/app/service/ndkprovider.service.ts | 1 + src/styles.scss | 4 +++ 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 584b8e0..00a9da1 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -38,7 +38,8 @@ import { arrowIcon, bubbleExclamationIcon, bitcoinIcon, - connectIcon + connectIcon, + refreshIcon } from '@cds/core/icon'; import { NdkproviderService } from './service/ndkprovider.service'; import { ActivatedRoute, NavigationEnd, RouteReuseStrategy, Router } from '@angular/router'; @@ -93,7 +94,8 @@ ClarityIcons.addIcons( paperclipIcon, wandIcon, downloadCloudIcon, - uploadCloudIcon + uploadCloudIcon, + refreshIcon ); @Component({ selector: 'app-root', diff --git a/src/app/component/event-feed/event-feed.component.html b/src/app/component/event-feed/event-feed.component.html index bef05d4..a34f234 100644 --- a/src/app/component/event-feed/event-feed.component.html +++ b/src/app/component/event-feed/event-feed.component.html @@ -23,6 +23,9 @@

+

@@ -55,6 +58,9 @@

  +   @@ -79,12 +85,21 @@

- - - +
+
+ + + +
+
+ +
+
diff --git a/src/app/component/event-feed/event-feed.component.ts b/src/app/component/event-feed/event-feed.component.ts index 8194961..fbd9ddb 100644 --- a/src/app/component/event-feed/event-feed.component.ts +++ b/src/app/component/event-feed/event-feed.component.ts @@ -67,6 +67,10 @@ export class EventFeedComponent implements OnInit,OnDestroy{ } } + this.ndkProvider.reloadFeedEmitter.subscribe((reloadNow: boolean )=> { + this.loadFeedFromBeginning(); + }) + this.ndkProvider.followedTopicsEmitter.subscribe((followedTopics: string) => { if (followedTopics === '') { this.followedTopics = []; diff --git a/src/app/service/ndkprovider.service.ts b/src/app/service/ndkprovider.service.ts index 5bcf446..376296a 100644 --- a/src/app/service/ndkprovider.service.ts +++ b/src/app/service/ndkprovider.service.ts @@ -86,6 +86,7 @@ export class NdkproviderService { canWriteToNostr: boolean = false; @Output() launchOnboardingWizard: EventEmitter = new EventEmitter(); + reloadFeedEmitter: EventEmitter = new EventEmitter(); constructor(private dbService: ZappeditdbService, private objectCache: ObjectCacheService, diff --git a/src/styles.scss b/src/styles.scss index 987d810..9eaeb08 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -308,6 +308,10 @@ a{ border-bottom-left-radius:10px } +.less-top-margin-feed-type{ + margin-top:0.2rem !important; +} + .reply-count-parent{ display: flex; align-content: flex-end !important;