Skip to content

Commit 17e1263

Browse files
committed
refactor: enhance error handling in location and event functions; add quick action links in renderer
1 parent 7f49c46 commit 17e1263

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

packages/r/karma1337/geo-resto/geo_resto.gno

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ func AddLocation(name, description string, latitude, longitude float64, category
154154
return "Rate limit exceeded. Please try again later."
155155
}
156156
location := locationManager.AddLocation(caller, name, description, latitude, longitude, category)
157+
if location == nil {
158+
return "Failed to add location"
159+
}
157160
return "Location added with ID: " + location.ID
158161
}
159162

@@ -171,6 +174,9 @@ func AddLocationStr(_ realm, name, description, latStr, lonStr, category string)
171174
func CheckIn(_ realm, locationID, proof string) string {
172175
caller := runtime.PreviousRealm().Address()
173176
visit := visitManager.CheckIn(caller, locationID, proof)
177+
if visit == nil {
178+
return "Failed to check-in"
179+
}
174180
return "Check-in successful! Visit ID: " + visit.ID
175181
}
176182

@@ -181,6 +187,9 @@ func CreateEvent(locationID, name, description string, eventType int, startTime,
181187
return "Rate limit exceeded. Please try again later."
182188
}
183189
event := eventManager.CreateEvent(caller, locationID, name, description, eventType, startTime, endTime)
190+
if event == nil {
191+
return "Failed to create event"
192+
}
184193
return "Event created with ID: " + event.ID
185194
}
186195

packages/r/karma1337/geo-resto/renderer.gno

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ func (r *Renderer) RenderMainPage() string {
4040
// Quick Actions
4141
sb.WriteString("## 📲 Quick Actions\n")
4242
addLocationLink := GetAddLocationTxLink("", "", 0, 0, "")
43+
checkInLink := GetCheckInTxLink("", "")
4344
sb.WriteString("- [➕ Add New Location](" + addLocationLink + ")\n\n")
45+
sb.WriteString("- [🔔 Check In to a Location](" + checkInLink + ")\n\n")
46+
47+
// Quick create event (user will fill details in wallet UI)
48+
createEventGenericLink := GetCreateEventTxLink("", "", "", 0, 0, 0)
49+
sb.WriteString("- [🎯 Create Event](" + createEventGenericLink + ")\n\n")
4450

4551
// Recent activity
4652
sb.WriteString("## 🔥 Recent Activity\n")
@@ -298,6 +304,10 @@ func (r *Renderer) RenderEvent(eventID string) string {
298304
sb.WriteString("## 📱 Event Verification\n\n")
299305
sb.WriteString("**QR Code**: `" + event.QRCode + "`\n\n")
300306

307+
// Organizer-only: Generate a Verify Attendee tx link (organizers use this to verify attendees)
308+
verifyLink := GetVerifyPresenceTxLink(event.ID, "", "")
309+
sb.WriteString("- [✅ Verify Attendee (organizer)](" + verifyLink + ")\n\n")
310+
301311
// Verification Statistics
302312
totalParticipants := len(event.Participants)
303313
verifiedCount := len(event.VerifiedAttendees)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
zkproof is hard
2+
3+
online event maybe
4+
5+
dynamic qrcode
6+
7+
otp auth to proof
8+
9+
create a transaction link to have an adena popup and do action like create event, register presence, etc etc
10+
11+
https://github.com/samouraiworld/zenao
12+
13+
https://gno.land/r/docs/txlink
14+
15+
16+
resolve address and retrieve username from address https://gno.land/r/docs/resolveusers

0 commit comments

Comments
 (0)