From 63ebbe73c2fb04090d04f31d149e9e755eb19ee3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?K=C3=A9vin=20Cocchi?= <kevin.cocchi@gmail.com>
Date: Tue, 12 Sep 2023 23:57:23 +0200
Subject: [PATCH] sendSticker takes sticker as arg instead of event

---
 web/src/index.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/web/src/index.js b/web/src/index.js
index d9b6b44..f828eda 100644
--- a/web/src/index.js
+++ b/web/src/index.js
@@ -296,10 +296,8 @@ class App extends Component {
 		this.sectionObserver.disconnect()
 	}
 
-	sendSticker(evt) {
-		const id = evt.currentTarget.getAttribute("data-sticker-id")
-		const sticker = this.stickersByID.get(id)
-		frequent.add(id)
+	sendSticker(sticker) {
+		frequent.add(sticker.id)
 		this.updateFrequentlyUsed()
 		widgetAPI.sendSticker(sticker)
 	}
@@ -431,7 +429,7 @@ const Pack = ({pack, send}) => html`
 `
 
 const Sticker = ({ sticker, send }) => html`
-	<div class="sticker" onClick=${send} data-sticker-id=${sticker.id}>
+	<div class="sticker" onClick=${() => send(sticker)}>
 		<img data-src=${makeThumbnailURL(sticker)} alt=${sticker.body} title=${sticker.body} />
 	</div>
 `
-- 
GitLab