system-worker progress
This commit is contained in:
@ -4,7 +4,7 @@ import { FormattedMessage } from "react-intl";
|
||||
import { injectIntl } from "react-intl";
|
||||
|
||||
import messages from "@/Components/messages";
|
||||
import { ProfileLoader } from "@/system";
|
||||
import { System } from "@/system";
|
||||
import { LoginStore } from "@/Utils/Login";
|
||||
|
||||
import AccountName from "./AccountName";
|
||||
@ -285,8 +285,8 @@ class IrisAccount extends Component<Props> {
|
||||
componentDidMount() {
|
||||
const session = LoginStore.snapshot();
|
||||
const myPub = session.publicKey;
|
||||
ProfileLoader.Cache.hook(() => {
|
||||
const profile = ProfileLoader.Cache.getFromCache(myPub);
|
||||
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) {
|
||||
|
@ -28,7 +28,7 @@ export function useRefreshFeedCache<T>(c: RefreshFeedCache<T>, leaveOpen = false
|
||||
const q = system.Query(NoopStore, sub);
|
||||
let t: ReturnType<typeof setTimeout> | undefined;
|
||||
let tBuf: Array<TaggedNostrEvent> = [];
|
||||
q.feed.on("event", evs => {
|
||||
q.on("event", evs => {
|
||||
if (!t) {
|
||||
tBuf = [...evs];
|
||||
t = setTimeout(() => {
|
||||
@ -41,9 +41,8 @@ export function useRefreshFeedCache<T>(c: RefreshFeedCache<T>, leaveOpen = false
|
||||
});
|
||||
q.uncancel();
|
||||
return () => {
|
||||
q.feed.off("event");
|
||||
q.off("event");
|
||||
q.cancel();
|
||||
q.sendClose();
|
||||
};
|
||||
}
|
||||
}, [sub]);
|
||||
|
Reference in New Issue
Block a user