From 6143977e17ea9dea0b70249ad180a4145fa5bf14 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Sun, 10 Jun 2018 17:14:40 +0900
Subject: [PATCH] refs #375 Encode tag for non ascii tags
---
src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js
index 91df8f8d..32030715 100644
--- a/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js
+++ b/src/renderer/store/TimelineSpace/Contents/Hashtag/Tag.js
@@ -72,7 +72,7 @@ const Tag = {
rootState.TimelineSpace.account.accessToken,
rootState.TimelineSpace.account.baseURL + '/api/v1'
)
- return client.get(`/timelines/tag/${tag}`, { limit: 40 })
+ return client.get(`/timelines/tag/${encodeURIComponent(tag)}`, { limit: 40 })
.then(data => {
commit('updateTimeline', data)
})
@@ -86,7 +86,7 @@ const Tag = {
})
return new Promise((resolve, reject) => {
ipcRenderer.send('start-tag-streaming', {
- tag: tag,
+ tag: encodeURIComponent(tag),
account: rootState.TimelineSpace.account
})
ipcRenderer.once('error-start-tag-streaming', (event, err) => {
@@ -106,6 +106,9 @@ const Tag = {
if (state.lazyLoading) {
return Promise.resolve(null)
}
+ if (obj.last === undefined || obj.last === null) {
+ return Promise.resolve(null)
+ }
commit('changeLazyLoading', true)
const client = new Mastodon(
rootState.TimelineSpace.account.accessToken,