diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 08ff05342..85c8b51c6 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -2,6 +2,7 @@
+
@@ -69,11 +70,11 @@
- + @@ -169,15 +170,15 @@

- + @@ -467,7 +468,6 @@ profile: {}, min_id: 0, max_id: 0, - stories: {}, suggestions: {}, loading: true, replies: [], @@ -579,7 +579,7 @@ axios.get(apiUrl, { params: { max_id: this.max_id, - limit: 5 + limit: 3 } }).then(res => { let data = res.data; @@ -596,6 +596,7 @@ if(this.hashtagPosts.length == 0) { this.fetchHashtagPosts(); } + // this.fetchStories(); }).catch(err => { swal( 'Oops, something went wrong', @@ -1159,14 +1160,14 @@ if(tags.length == 0) { return; } - let hashtag = tags[0]; + let hashtag = tags[Math.floor(Math.random(), tags.length)]; this.hashtagPostsName = hashtag; axios.get('/api/v2/discover/tag', { params: { hashtag: hashtag } }).then(res => { - if(res.data.tags.length) { + if(res.data.tags.length > 3) { this.showHashtagPosts = true; this.hashtagPosts = res.data.tags.splice(0,3); } @@ -1210,7 +1211,7 @@ ctxMenuGoToPost() { let status = this.ctxMenuStatus; - window.location.href = status.url; + window.location.href = this.statusUrl(status); this.closeCtxMenu(); return; }, @@ -1302,8 +1303,57 @@ formatCount(count) { return App.util.format.count(count); - } + }, + statusUrl(status) { + return status.url; + + // if(status.local == true) { + // return status.url; + // } + + // return '/i/web/post/_/' + status.account.id + '/' + status.id; + }, + + profileUrl(status) { + return status.account.url; + // if(status.local == true) { + // return status.account.url; + // } + + // return '/i/web/profile/_/' + status.account.id; + }, + + statusCardUsernameFormat(status) { + if(status.account.local == true) { + return status.account.username; + } + + let fmt = window.App.config.username.remote.format; + let txt = window.App.config.username.remote.custom; + let usr = status.account.username; + let dom = document.createElement('a'); + dom.href = status.account.url; + dom = dom.hostname; + + switch(fmt) { + case '@': + return usr + '@' + dom + ''; + break; + + case 'from': + return usr + ' from ' + dom + ''; + break; + + case 'custom': + return usr + ' ' + txt + ' ' + dom + ''; + break; + + default: + return usr + '@' + dom + ''; + break; + } + }, } } - + \ No newline at end of file