From 22ffb45187d48108788d23f6c8f3f1a86427b736 Mon Sep 17 00:00:00 2001 From: Mohammed Alhaddar Date: Tue, 2 Jul 2024 22:39:05 +0300 Subject: [PATCH 1/2] - Paste and stay now actually stays - Fixed `this` to refer to the class context --- emoji-copy@felipeftn/emojiButton.js | 12 ++---------- emoji-copy@felipeftn/metadata.json | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/emoji-copy@felipeftn/emojiButton.js b/emoji-copy@felipeftn/emojiButton.js index 04f6a1b..7f450d3 100644 --- a/emoji-copy@felipeftn/emojiButton.js +++ b/emoji-copy@felipeftn/emojiButton.js @@ -49,7 +49,7 @@ export class EmojiButton { can_focus: true, label: this.baseCharacter, }); - + // Copy the emoji to the clipboard with adequate tags and behavior this.super_btn.connect("button-press-event", this.onButtonPress.bind(this)); this.super_btn.connect("key-press-event", this.onKeyPress.bind(this)); @@ -162,25 +162,17 @@ export class EmojiButton { emojiToCopy, ); - if (this._settings.get_boolean("paste-on-select")) { - this.triggerPasteHack(); - } - return Clutter.EVENT_STOP; } addToClipboardAndStay(emojiToCopy) { - this.clipboard.get_text(CLIPBOARD_TYPE, function (_, text) { + this.clipboard.get_text(CLIPBOARD_TYPE, (_, text) => { this.clipboard.set_text( CLIPBOARD_TYPE, text + emojiToCopy, ); }); - if (this._settings.get_boolean("paste-on-select")) { - this.triggerPasteHack(); - } - return Clutter.EVENT_STOP; } diff --git a/emoji-copy@felipeftn/metadata.json b/emoji-copy@felipeftn/metadata.json index 6180936..c2c36e9 100644 --- a/emoji-copy@felipeftn/metadata.json +++ b/emoji-copy@felipeftn/metadata.json @@ -6,5 +6,5 @@ "url": "https://github.com/felipeftn/emoji-copy", "settings-schema": "org.gnome.shell.extensions.emoji-copy", "gettext-domain": "emoji-copy", - "version": 22 + "version": 23 } From 31f47cbf15ea5640f54f753b4209c305c1cdbefa Mon Sep 17 00:00:00 2001 From: Mohammed Alhaddar Date: Wed, 3 Jul 2024 18:10:24 +0300 Subject: [PATCH 2/2] Fix linting errors --- emoji-copy@felipeftn/handlers/sql.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/emoji-copy@felipeftn/handlers/sql.js b/emoji-copy@felipeftn/handlers/sql.js index ecb7ce7..4256ce5 100644 --- a/emoji-copy@felipeftn/handlers/sql.js +++ b/emoji-copy@felipeftn/handlers/sql.js @@ -44,9 +44,9 @@ export class SQLite { } increment_selection(unicode) { - this.query( - `UPDATE emojis SET clicked_times = clicked_times + 1 WHERE unicode = '${unicode}'` - ) + return this.query(` + UPDATE emojis SET clicked_times = clicked_times + 1 WHERE unicode = '${unicode}' + `); } search_description(search_text, skin_tone = 0) { @@ -93,7 +93,7 @@ export class SQLite { item.description = data[1]; item.skin_tone = data[2]; item.group = data[3]; - item.clicked_times = data[4] + item.clicked_times = data[4]; return item; }); return result;