mirror of
https://github.com/BlowaterNostr/blowater.git
synced 2024-10-18 07:33:22 +00:00
limit kind 1 querying to 24 hours (#413)
This commit is contained in:
parent
18f561a620
commit
72307e372e
@ -352,7 +352,7 @@ export class AppComponent extends Component<AppProps> {
|
||||
}
|
||||
|
||||
let socialNode: VNode | undefined;
|
||||
if (model.navigationModel.activeNav == "Social" && model.currentRelay) {
|
||||
if (model.navigationModel.activeNav == "Public" && model.currentRelay) {
|
||||
socialNode = (
|
||||
<ChannelContainer
|
||||
ctx={myAccountCtx}
|
||||
@ -511,6 +511,7 @@ async function sync_profile_events(
|
||||
const sync_kind_1 = async (pool: ConnectionPool, database: Database_View) => {
|
||||
const stream = await pool.newSub("sync_kind_1", {
|
||||
kinds: [NostrKind.TEXT_NOTE],
|
||||
since: Math.floor(Date.now() / 1000) - 24 * 60 * 60, // 24 hours
|
||||
});
|
||||
if (stream instanceof Error) {
|
||||
return stream;
|
||||
|
@ -40,7 +40,7 @@ export function initialModel(): Model {
|
||||
value: "",
|
||||
},
|
||||
navigationModel: {
|
||||
activeNav: "Social",
|
||||
activeNav: "Public",
|
||||
},
|
||||
myProfile: undefined,
|
||||
};
|
||||
|
@ -364,15 +364,25 @@ export async function* UI_Interaction_Update(args: {
|
||||
title: "Relays",
|
||||
fields: Array.from(app.database.getRelayRecord(nostrEvent.id)),
|
||||
},
|
||||
{
|
||||
];
|
||||
if (nostrEvent.kind == NostrKind.DIRECT_MESSAGE) {
|
||||
items.push({
|
||||
title: "Content",
|
||||
fields: [
|
||||
content,
|
||||
event.message.content,
|
||||
originalEventRaw,
|
||||
],
|
||||
},
|
||||
];
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
title: "Content",
|
||||
fields: [
|
||||
event.message.content,
|
||||
originalEventRaw,
|
||||
],
|
||||
});
|
||||
}
|
||||
app.popOverInputChan.put({
|
||||
children: (
|
||||
<EventDetail
|
||||
@ -558,7 +568,7 @@ export async function handle_SendMessage(
|
||||
}
|
||||
}
|
||||
events = events_send;
|
||||
} else if (args.navigationModel.activeNav == "Social") {
|
||||
} else if (args.navigationModel.activeNav == "Public") {
|
||||
const nostr_event = await prepareNormalNostrEvent(ctx, {
|
||||
content: event.text,
|
||||
kind: NostrKind.TEXT_NOTE,
|
||||
|
@ -57,7 +57,7 @@ type State = {
|
||||
installPrompt: InstallPrompt;
|
||||
};
|
||||
|
||||
type NavTabID = "Social" | "DM" | "Search" | "Profile" | "About" | "Setting";
|
||||
type NavTabID = "Public" | "DM" | "Search" | "Profile" | "About" | "Setting";
|
||||
type NavTab = {
|
||||
icon: (active: boolean) => ComponentChild;
|
||||
id: NavTabID;
|
||||
@ -89,7 +89,7 @@ export class NavBar extends Component<Props, State> {
|
||||
tabs: NavTab[] = [
|
||||
{
|
||||
icon: (active: boolean) => <SocialIcon class={this.styles.icons(active)} />,
|
||||
id: "Social",
|
||||
id: "Public",
|
||||
},
|
||||
{
|
||||
icon: (active: boolean) => <ChatIcon class={this.styles.icons(active)} />,
|
||||
|
Loading…
Reference in New Issue
Block a user