biome format --write
This commit is contained in:
parent
8372348148
commit
9262e803ec
415 changed files with 54076 additions and 17419 deletions
|
|
@ -2,7 +2,7 @@ import apiService from '../../services/api/api.service.js'
|
|||
import generateProfileLink from 'src/services/user_profile_link_generator/user_profile_link_generator'
|
||||
import { shuffle } from 'lodash'
|
||||
|
||||
function showWhoToFollow (panel, reply) {
|
||||
function showWhoToFollow(panel, reply) {
|
||||
const shuffled = shuffle(reply)
|
||||
|
||||
panel.usersToFollow.forEach((toFollow, index) => {
|
||||
|
|
@ -13,7 +13,8 @@ function showWhoToFollow (panel, reply) {
|
|||
toFollow.img = img
|
||||
toFollow.name = name
|
||||
|
||||
panel.$store.state.api.backendInteractor.fetchUser({ id: name })
|
||||
panel.$store.state.api.backendInteractor
|
||||
.fetchUser({ id: name })
|
||||
.then((externalUser) => {
|
||||
if (!externalUser.error) {
|
||||
panel.$store.commit('addNewUsers', [externalUser])
|
||||
|
|
@ -23,56 +24,56 @@ function showWhoToFollow (panel, reply) {
|
|||
})
|
||||
}
|
||||
|
||||
function getWhoToFollow (panel) {
|
||||
function getWhoToFollow(panel) {
|
||||
const credentials = panel.$store.state.users.currentUser.credentials
|
||||
if (credentials) {
|
||||
panel.usersToFollow.forEach(toFollow => {
|
||||
panel.usersToFollow.forEach((toFollow) => {
|
||||
toFollow.name = 'Loading...'
|
||||
})
|
||||
apiService.suggestions({ credentials })
|
||||
.then((reply) => {
|
||||
showWhoToFollow(panel, reply)
|
||||
})
|
||||
apiService.suggestions({ credentials }).then((reply) => {
|
||||
showWhoToFollow(panel, reply)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const WhoToFollowPanel = {
|
||||
data: () => ({
|
||||
usersToFollow: []
|
||||
usersToFollow: [],
|
||||
}),
|
||||
computed: {
|
||||
user: function () {
|
||||
return this.$store.state.users.currentUser.screen_name
|
||||
},
|
||||
suggestionsEnabled () {
|
||||
suggestionsEnabled() {
|
||||
return this.$store.state.instance.suggestionsEnabled
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
userProfileLink (id, name) {
|
||||
return generateProfileLink(id, name, this.$store.state.instance.restrictedNicknames)
|
||||
}
|
||||
userProfileLink(id, name) {
|
||||
return generateProfileLink(
|
||||
id,
|
||||
name,
|
||||
this.$store.state.instance.restrictedNicknames,
|
||||
)
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
user: function () {
|
||||
if (this.suggestionsEnabled) {
|
||||
getWhoToFollow(this)
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted: function () {
|
||||
this.usersToFollow = new Array(3).fill().map(() => ({
|
||||
img: this.$store.state.instance.defaultAvatar,
|
||||
name: '',
|
||||
id: 0,
|
||||
}))
|
||||
if (this.suggestionsEnabled) {
|
||||
getWhoToFollow(this)
|
||||
}
|
||||
},
|
||||
mounted:
|
||||
function () {
|
||||
this.usersToFollow = new Array(3).fill().map(() => (
|
||||
{
|
||||
img: this.$store.state.instance.defaultAvatar,
|
||||
name: '',
|
||||
id: 0
|
||||
}
|
||||
))
|
||||
if (this.suggestionsEnabled) {
|
||||
getWhoToFollow(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default WhoToFollowPanel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue