Ensure that the latest profile is used for initial profile import

This commit is contained in:
SondreB 2023-01-20 01:24:16 +01:00
parent c2c38b9a2d
commit 7d4f4867d0
No known key found for this signature in database
GPG Key ID: D6CC44C75005FDBF
4 changed files with 30 additions and 11 deletions

View File

@ -230,11 +230,18 @@ export class AppComponent {
return;
}
const following = this.profileService.profile?.following;
const pubkeys = data.tags.map((t: any[]) => t[1]);
debugger;
if (!following) {
this.openImportSheet({ pubkeys: pubkeys, pubkey: data.pubkey });
// Sometimes we might discover newer or older profiles, make sure we only update UI dialog if newer.
if (this.discoveredProfileDate < data.created_at) {
this.discoveredProfileDate = data.created_at;
const following = this.profileService.profile?.following;
const pubkeys = data.tags.map((t: any[]) => t[1]);
if (!following) {
this.openImportSheet({ pubkeys: pubkeys, pubkey: data.pubkey });
}
}
},
});
@ -251,6 +258,8 @@ export class AppComponent {
// });
}
discoveredProfileDate = 0;
async ngOnInit() {
this.theme.init();

View File

@ -17,8 +17,18 @@
<mat-card-title>Activity Feed</mat-card-title>
</mat-card-header>
<mat-card-content>
<p>cameri liked your post</p>
<p>Milad commented on your post</p>
<p><a routerLink="/p/00000000827ffaa94bfea288c3dfce4422c794fbb96625b6b31e9049f729d700">cameri</a> liked your <a routerLink="/e/2145bd1f4862724f04b4ef7c788e3fcbb88a255c3173b14dcca9d489ae38a6d4">post</a></p>
<p><a routerLink="/p/5f432a9f39b58ff132fc0a4c8af10d42efd917d8076f68bb7f2f91ed7d4f6a41">Milad</a> commented on your <a routerLink="/e/2145bd1f4862724f04b4ef7c788e3fcbb88a255c3173b14dcca9d489ae38a6d4">post</a></p>
</mat-card-content>
</mat-card>
<mat-card class="home-card">
<mat-card-header>
<mat-card-title>News</mat-card-title>
</mat-card-header>
<mat-card-content>
<p>01-19: <a routerLink="/e/63f78a0588f88c5e6931efcf032c8f600656eb5425785aea99b15ce0967be4a7">Nostr conference is in the planning</a>.</p>
<p>01-20: Blockcore Notes "Home" launched as UI-mockup.</p>
</mat-card-content>
</mat-card>
@ -104,7 +114,7 @@
<mat-card class="home-card">
<mat-card-header>
<img mat-card-avatar src="https://material.angular.io/assets/img/examples/shiba1.jpg">
<img mat-card-avatar src="https://material.angular.io/assets/img/examples/shiba1.jpg" />
<mat-card-title>Shiba Inu</mat-card-title>
<mat-card-subtitle>Dog Breed</mat-card-subtitle>
</mat-card-header>
@ -117,7 +127,6 @@
<button mat-button>Comments</button>
</mat-card-actions>
</mat-card>
</div>
</div>

View File

@ -297,7 +297,7 @@ export class UserComponent {
// this.notesService.currentViewNotes.sort((a, b) => (a.created_at < b.created_at ? 1 : -1));
// this.#changed();
},
100
200
);
// setTimeout(async () => {

View File

@ -200,11 +200,12 @@ h3 {
a {
// color: rgb(206, 206, 206);
color: #c7b3ea !important;
text-decoration: none;
}
a:hover {
color: #c7b3ea;
text-decoration: none;
color: #9c27b0 !important;
transition: text-decoration 250ms ease;
transition: color 250ms ease;
}