@@ -2,7 +2,7 @@ import { Component, Input } from '@angular/core';
2
2
import { NotesService } from 'src/app/services/notes' ;
3
3
import { ProfileService } from 'src/app/services/profile' ;
4
4
import { Utilities } from 'src/app/services/utilities' ;
5
- import { NostrEventDocument , NostrNoteDocument , NostrProfile , NostrProfileDocument } from '../../services/interfaces' ;
5
+ import { NostrEventDocument , NostrNoteDocument , NostrProfile , NostrProfileDocument , ProfileStatus } from '../../services/interfaces' ;
6
6
import { MatSnackBar } from '@angular/material/snack-bar' ;
7
7
import { copyToClipboard } from '../utilities' ;
8
8
import { nip19 } from 'nostr-tools' ;
@@ -44,16 +44,23 @@ export class EventActionsComponent {
44
44
async follow ( circle ?: number ) {
45
45
console . log ( 'FOLLOW:' , this . profile ) ;
46
46
47
+ if ( circle == null ) {
48
+ circle = 0 ;
49
+ }
50
+
47
51
if ( ! this . profile ) {
48
52
return ;
49
53
}
50
54
51
55
// If not already following, add a full follow and download recent:
52
56
if ( this . profile . status != 1 ) {
57
+ this . profile . circle = circle ;
58
+ this . profile . status = 1 ;
53
59
await this . profileService . follow ( this . profile . pubkey , circle ) ;
54
60
// this.feedService.downloadRecent([this.profile.pubkey]);
55
61
} else {
56
62
// If we already follow but just change the circle, do a smaller operation.
63
+ this . profile . circle = circle ;
57
64
await this . profileService . setCircle ( this . profile . pubkey , circle ) ;
58
65
}
59
66
}
@@ -141,7 +148,7 @@ export class EventActionsComponent {
141
148
if ( ! this . profile ) {
142
149
return ;
143
150
}
144
-
151
+ this . profile . status = 0 ;
145
152
await this . profileService . unfollow ( this . profile . pubkey ) ;
146
153
}
147
154
@@ -184,9 +191,10 @@ export class EventActionsComponent {
184
191
185
192
if ( this . event ) {
186
193
this . pubkey = this . event . pubkey ;
187
- // this.profile = await this.profileService.getProfile(this.pubkey);
194
+ this . profile = await this . profileService . getProfile ( this . pubkey ) ;
188
195
} else if ( this . profile ) {
189
196
this . pubkey = this . profile . pubkey ;
197
+ this . profile = await this . profileService . getProfile ( this . pubkey ) ;
190
198
} else {
191
199
// this.profile = await this.profileService.getProfile(this.pubkey);
192
200
}
0 commit comments