~tomtom/damus

378af1dcacb56259d816ef9282710912ae0c682a — Thomas Mathews a month ago bb680be
Use shaka instead of heart.
4 files changed, 4 insertions(+), 3 deletions(-)

M js/core.js
M js/ui/render.js
M js/ui/state.js
M js/ui/util.js
M js/core.js => js/core.js +1 -0
@@ 12,6 12,7 @@ const TAG_P = "#p";
const TAG_E = "#e";

const R_HEART = "❤️";
const R_SHAKA = "🤙";

const STANDARD_KINDS = [
	KIND_NOTE,

M js/ui/render.js => js/ui/render.js +1 -1
@@ 196,7 196,7 @@ function render_action_bar(model, ev, opts={}) {
	let { can_delete, shared } = opts;
	// TODO rewrite all of the toggle heart code. It's mine & I hate it.
	const thread_root = (ev.refs && ev.refs.root) || ev.id;
	const reaction = model_get_reacts_to(model, pubkey, ev.id, R_HEART);
	const reaction = model_get_reacts_to(model, pubkey, ev.id, R_SHAKA);
	const liked = !!reaction;
	const reaction_id = reaction ? reaction.id : "";
	let str = html`<div class="action-bar">`;

M js/ui/state.js => js/ui/state.js +1 -1
@@ 486,7 486,7 @@ function view_timeline_update_reaction(model, ev) {

	// Update like button
	if (ev.pubkey == model.pubkey) {
		const reaction = model_get_reacts_to(model, model.pubkey, ev_id, R_HEART);
		const reaction = model_get_reacts_to(model, model.pubkey, ev_id, R_SHAKA);
		const liked = !!reaction;
		const img = find_node("button.icon.heart > img", root);
		const btn = find_node("button.icon.heart", root)

M js/ui/util.js => js/ui/util.js +1 -1
@@ 58,7 58,7 @@ function click_toggle_like(el) {
		delete_post(el.dataset.reactionId);
		return;
	}
	send_reply(R_HEART, el.dataset.reactingTo);
	send_reply(R_SHAKA, el.dataset.reactingTo);
}

/* open_media_preview presents a modal to display an image via "url".