We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30d3ce6 commit 3878d89Copy full SHA for 3878d89
ndk-mobile/src/stores/session.ts
@@ -59,11 +59,13 @@ export const useSessionStore = create<SessionState>((set) => ({
59
// safety check for replaceable events
60
if (event.isReplaceable()) {
61
const existingEvent = existing.find((e) => e.dTag === event.dTag)
62
- if (existingEvent && existingEvent.created_at >= event.created_at) {
63
- return state
64
- } else {
65
- // remove the existing event
66
- existing = existing.filter((e) => e.id !== existingEvent.id)
+ if (existingEvent) {
+ if (existingEvent.created_at >= event.created_at) {
+ return state
+ } else {
+ // remove the existing event
67
+ existing = existing.filter((e) => e.id !== existingEvent.id)
68
+ }
69
}
70
71
0 commit comments