refactor: Query emits Filters
This commit is contained in:
@ -285,15 +285,20 @@ class IrisAccount extends Component<Props> {
|
||||
componentDidMount() {
|
||||
const session = LoginStore.snapshot();
|
||||
const myPub = session.publicKey;
|
||||
System.ProfileLoader.Cache.hook(() => {
|
||||
const profile = System.ProfileLoader.Cache.getFromCache(myPub);
|
||||
const irisToActive = profile && profile.nip05 && profile.nip05.endsWith("@iris.to");
|
||||
this.setState({ profile, irisToActive });
|
||||
if (profile && !irisToActive) {
|
||||
this.checkExistingAccount(myPub);
|
||||
}
|
||||
}, myPub);
|
||||
this.checkExistingAccount(myPub);
|
||||
if (myPub) {
|
||||
System.profileLoader.cache.on("change", keys => {
|
||||
if (keys.includes(myPub)) {
|
||||
const profile = System.profileLoader.cache.getFromCache(myPub);
|
||||
const irisToActive = profile && profile.nip05 && profile.nip05.endsWith("@iris.to");
|
||||
this.setState({ profile, irisToActive });
|
||||
if (profile && !irisToActive) {
|
||||
this.checkExistingAccount(myPub);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.checkExistingAccount(myPub);
|
||||
}
|
||||
}
|
||||
|
||||
async checkExistingAccount(pub: any) {
|
||||
|
@ -18,7 +18,7 @@ export function ProfileLink({
|
||||
children?: ReactNode;
|
||||
} & Omit<LinkProps, "to">) {
|
||||
const system = useContext(SnortContext);
|
||||
const relays = system.RelayCache.getFromCache(pubkey)
|
||||
const relays = system.relayCache.getFromCache(pubkey)
|
||||
?.relays?.filter(a => a.settings.write)
|
||||
?.map(a => a.url);
|
||||
|
||||
|
Reference in New Issue
Block a user