aboutsummaryrefslogtreecommitdiff
path: root/src/components/who_to_follow_panel
diff options
context:
space:
mode:
authorHakaba Hitoyo <hakabahitoyo@example.com>2018-08-02 17:57:00 +0900
committerHakaba Hitoyo <hakabahitoyo@example.com>2018-08-02 17:57:00 +0900
commitbcd499c3725d620bc9d4612e04add76cf7a4e395 (patch)
tree5bc3bfc2294f4a2cd09377eee1593ae9c088e69e /src/components/who_to_follow_panel
parent32fd108e97de8a1e1201bcc31f70af9ace77e517 (diff)
who to follow panel uses /api/v1/suggestions
Diffstat (limited to 'src/components/who_to_follow_panel')
-rw-r--r--src/components/who_to_follow_panel/who_to_follow_panel.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/components/who_to_follow_panel/who_to_follow_panel.js b/src/components/who_to_follow_panel/who_to_follow_panel.js
index 51b9f469..be9a9f31 100644
--- a/src/components/who_to_follow_panel/who_to_follow_panel.js
+++ b/src/components/who_to_follow_panel/who_to_follow_panel.js
@@ -7,12 +7,12 @@ function showWhoToFollow (panel, reply, aHost, aUser) {
var user
user = users[cn]
var img
- if (user.icon) {
+ if (user.avatar) {
img = user.icon
} else {
img = '/images/avi.png'
}
- var name = user.to_id
+ var name = user.acct
if (index === 0) {
panel.img1 = img
panel.name1 = name
@@ -52,17 +52,13 @@ function showWhoToFollow (panel, reply, aHost, aUser) {
}
function getWhoToFollow (panel) {
- var user = panel.$store.state.users.currentUser.screen_name
- if (user) {
+ var credentials = panel.$store.state.users.currentUser.credentials
+ if (credentials) {
panel.name1 = 'Loading...'
panel.name2 = 'Loading...'
panel.name3 = 'Loading...'
- var host = window.location.hostname
- var whoToFollowProvider = panel.$store.state.config.whoToFollowProvider
- var url
- url = whoToFollowProvider.replace(/{{host}}/g, encodeURIComponent(host))
- url = url.replace(/{{user}}/g, encodeURIComponent(user))
- window.fetch(url, {mode: 'cors'}).then(function (response) {
+ var url = '/api/v1/suggestions'
+ window.fetch(url, {headers: authHeaders(credentials)}).then(function (response) {
if (response.ok) {
return response.json()
} else {