aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-29 13:22:16 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-29 13:22:16 +0200
commitf97f67ebd6a9cd3b5a2b7ee295dad7dbb8fb2828 (patch)
tree7e0b55dbe0a7887d9db7c6396cd4a7ac205496fa /src/plugins
parentb6d0849845b87df7b8d733befc9773752aa08f53 (diff)
Fix scroll position after lazy load on youtube, scroll in room after new message in matrix
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/Matrix.cpp1
-rw-r--r--src/plugins/Youtube.cpp8
2 files changed, 3 insertions, 6 deletions
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index 552762a..f9cdab5 100644
--- a/src/plugins/Matrix.cpp
+++ b/src/plugins/Matrix.cpp
@@ -691,7 +691,6 @@ namespace QuickMedia {
else
body->items.insert(body->items.begin() + (i - 1), std::move(body_item_to_insert));
if((int)i < selected_item && room_body_index > selected_item && body->items.size() > 1 && i != body->items.size() - 1) {
- body->select_first_item();
body->select_next_item();
}
return;
diff --git a/src/plugins/Youtube.cpp b/src/plugins/Youtube.cpp
index e4f152f..d164bc5 100644
--- a/src/plugins/Youtube.cpp
+++ b/src/plugins/Youtube.cpp
@@ -813,11 +813,9 @@ namespace QuickMedia {
}
std::optional<std::string> vote_count = yt_json_get_text(comment_renderer_json, "voteCount");
- if(vote_count) {
- if(!description.empty())
- description += '\n';
- description += "👍 " + vote_count.value();
- }
+ if(!description.empty())
+ description += '\n';
+ description += "👍 " + vote_count.value_or("0");
const Json::Value &reply_count_json = comment_renderer_json["replyCount"];
if(reply_count_json.isInt64() && reply_count_json.asInt64() > 0) {