mirror of
https://github.com/block-core/blockcore-notes.git
synced 2024-09-29 06:20:42 +00:00
Complete the following list import functionality
This commit is contained in:
parent
755a2fa76a
commit
431f59887e
@ -36,21 +36,13 @@
|
||||
<mat-icon>content_copy</mat-icon>
|
||||
<span>Public Keys (hex)</span>
|
||||
</button>
|
||||
<!-- <button mat-menu-item (click)="copyProfile()">
|
||||
<mat-icon>content_copy</mat-icon>
|
||||
<span>Profiles</span>
|
||||
</button> -->
|
||||
</mat-menu>
|
||||
|
||||
<!-- <button *ngIf="!fab" class="action-button" mat-icon-button [matMenuTriggerFor]="menu">
|
||||
<mat-icon class="action-button-icon">more_vert</mat-icon>
|
||||
</button> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="circle-actions">
|
||||
<button mat-stroked-button (click)="importFollowList()">Import Follow List</button>
|
||||
<button mat-stroked-button (click)="publishFollowList()">Publish Follow List</button>
|
||||
<button mat-stroked-button (click)="importFollowList()">Import Following List</button>
|
||||
<!-- <button mat-stroked-button (click)="publishFollowList()">Publish Follow List</button> -->
|
||||
</p>
|
||||
|
||||
<p class="dimmed">Circles is how you organize people you follow. Different circles can have different rules applied and circles is an important way to make the experience more enjoyable.</p>
|
||||
|
@ -83,7 +83,7 @@ export class CirclesComponent {
|
||||
verticalPosition: 'bottom',
|
||||
});
|
||||
|
||||
let pubkey = result.pubkey;
|
||||
let pubkey = this.utilities.ensureHexIdentifier(result.pubkey);
|
||||
|
||||
console.log('GET FOLLOWING LIST FOR:', pubkey);
|
||||
|
||||
|
@ -36,7 +36,7 @@ export class ConnectComponent {
|
||||
await this.relayService.appendRelays(relays);
|
||||
|
||||
// Initiate connections against registered relays.
|
||||
this.relayService.connect();
|
||||
// this.relayService.connect();
|
||||
|
||||
this.router.navigateByUrl('/');
|
||||
}
|
||||
|
@ -125,9 +125,7 @@ export class PeopleComponent {
|
||||
return;
|
||||
}
|
||||
|
||||
if (pubkey.startsWith('npub')) {
|
||||
pubkey = this.utilities.arrayToHex(this.utilities.convertFromBech32(pubkey));
|
||||
}
|
||||
pubkey = this.utilities.ensureHexIdentifier(pubkey);
|
||||
|
||||
await this.profileService.follow(pubkey);
|
||||
await this.feedService.downloadRecent([pubkey]);
|
||||
|
@ -598,6 +598,20 @@ export class RelayService {
|
||||
}
|
||||
|
||||
async initialize() {
|
||||
if (this.relays.length === 0) {
|
||||
let relays;
|
||||
|
||||
try {
|
||||
const gt = globalThis as any;
|
||||
relays = await gt.nostr.getRelays();
|
||||
} catch (err) {
|
||||
relays = this.defaultRelays;
|
||||
}
|
||||
|
||||
// First append whatever the extension give us of relays.
|
||||
await this.appendRelays(relays);
|
||||
}
|
||||
|
||||
// Whenever the profile service needs to get a profile from the network, this event is triggered.
|
||||
// this.profileService.profileRequested$.subscribe(async (pubkey) => {
|
||||
// if (!pubkey) {
|
||||
|
@ -16,6 +16,14 @@ export class Utilities {
|
||||
return converted;
|
||||
}
|
||||
|
||||
ensureHexIdentifier(pubkey: string) {
|
||||
if (pubkey.startsWith('npub')) {
|
||||
pubkey = this.arrayToHex(this.convertFromBech32(pubkey));
|
||||
}
|
||||
|
||||
return pubkey;
|
||||
}
|
||||
|
||||
getHexIdentifier(pubkey: string) {
|
||||
const key = this.hexToArray(pubkey);
|
||||
const converted = this.convertToBech32(key, 'npub');
|
||||
|
Loading…
Reference in New Issue
Block a user