Merge pull request #6939 from pixelfed/staging

Staging
pull/6980/head
dansup 4 weeks ago committed by GitHub
commit adff127f4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

File diff suppressed because one or more lines are too long

@ -1 +1 @@
(()=>{"use strict";var e,r,o,a={},d={};function t(e){var r=d[e];if(void 0!==r)return r.exports;var o=d[e]={id:e,loaded:!1,exports:{}};return a[e].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=a,e=[],t.O=(r,o,a,d)=>{if(!o){var n=1/0;for(f=0;f<e.length;f++){for(var[o,a,d]=e[f],c=!0,s=0;s<o.length;s++)(!1&d||n>=d)&&Object.keys(t.O).every(e=>t.O[e](o[s]))?o.splice(s--,1):(c=!1,d<n&&(n=d));if(c){e.splice(f--,1);var i=a();void 0!==i&&(r=i)}}return r}d=d||0;for(var f=e.length;f>0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[o,a,d]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,o)=>(t.f[o](e,r),r),[])),t.u=e=>"js/"+{529:"groups-page",1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2822:"group.create",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6438:"groups-page-media",6535:"discover.chunk",6740:"discover~memories.chunk",6791:"groups-page-members",7206:"groups-page-topics",7342:"groups-post",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8257:"groups-page-about",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9231:"groups-profile",9919:"changelog.bundle"}[e]+"."+{529:"2826b7d8bc08bf22",1179:"2e39a13fa12d0d01",1240:"fa7fd5597bfbf81c",1645:"30a324bbbe437db7",2156:"13a1bf15db918fb7",2822:"82affc4a7b5983b0",2966:"43d7fefd51744728",3688:"899d6ab4a7d0dd14",4951:"e4af088f458b12ae",6250:"46eb9fa72bdbfafa",6438:"f3be2d8b0ca59cdf",6535:"0a3c5b36cedbad42",6740:"17874e2d9dfb4f00",6791:"a2d12bc765ad0f38",7206:"7bee36f3edc0de92",7342:"aca9f85bd8b36f70",7399:"ca55c5d89171edc4",7413:"c408e3fce0f80bcb",7521:"2d3007cfd414b33a",7744:"d2559e00a1a30220",8087:"08904b4d996ac4ad",8119:"9ffc0aacc1ff49e5",8257:"dfb2744b2a28d4c5",8408:"fb5fcbe76fc9cc5f",8977:"8381cac06885ce77",9124:"cb3781f6e49426e4",9231:"924132e02f73d082",9919:"f97c6c2fdd203b90"}[e]+".js",t.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",4370:"css/profile",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},o="pixelfed:",t.l=(e,a,d,n)=>{if(r[e])r[e].push(a);else{var c,s;if(void 0!==d)for(var i=document.getElementsByTagName("script"),f=0;f<i.length;f++){var l=i[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+d){c=l;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",t.nc&&c.setAttribute("nonce",t.nc),c.setAttribute("data-webpack",o+d),c.src=e),r[e]=[a];var u=(o,a)=>{c.onerror=c.onload=null,clearTimeout(b);var d=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),d&&d.forEach(e=>e(a)),o)return o(a)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=u.bind(null,c.onerror),c.onload=u.bind(null,c.onload),s&&document.head.appendChild(c)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,4370:0,8759:0};t.f.j=(r,o)=>{var a=t.o(e,r)?e[r]:void 0;if(0!==a)if(a)o.push(a[2]);else if(/^((69|82)52|2305|2540|3364|4370|461|8759)$/.test(r))e[r]=0;else{var d=new Promise((o,d)=>a=e[r]=[o,d]);o.push(a[2]=d);var n=t.p+t.u(r),c=new Error;t.l(n,o=>{if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var d=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;c.message="Loading chunk "+r+" failed.\n("+d+": "+n+")",c.name="ChunkLoadError",c.type=d,c.request=n,a[1](c)}},"chunk-"+r,r)}},t.O.j=r=>0===e[r];var r=(r,o)=>{var a,d,[n,c,s]=o,i=0;if(n.some(r=>0!==e[r])){for(a in c)t.o(c,a)&&(t.m[a]=c[a]);if(s)var f=s(t)}for(r&&r(o);i<n.length;i++)d=n[i],t.o(e,d)&&e[d]&&e[d][0](),e[d]=0;return t.O(f)},o=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),t.nc=void 0})();
(()=>{"use strict";var e,r,o,a={},d={};function t(e){var r=d[e];if(void 0!==r)return r.exports;var o=d[e]={id:e,loaded:!1,exports:{}};return a[e].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}t.m=a,e=[],t.O=(r,o,a,d)=>{if(!o){var n=1/0;for(f=0;f<e.length;f++){for(var[o,a,d]=e[f],c=!0,s=0;s<o.length;s++)(!1&d||n>=d)&&Object.keys(t.O).every(e=>t.O[e](o[s]))?o.splice(s--,1):(c=!1,d<n&&(n=d));if(c){e.splice(f--,1);var i=a();void 0!==i&&(r=i)}}return r}d=d||0;for(var f=e.length;f>0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[o,a,d]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var o in r)t.o(r,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:r[o]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce((r,o)=>(t.f[o](e,r),r),[])),t.u=e=>"js/"+{529:"groups-page",1179:"daci.chunk",1240:"discover~myhashtags.chunk",1645:"profile~following.bundle",2156:"dms.chunk",2822:"group.create",2966:"discover~hashtag.bundle",3688:"discover~serverfeed.chunk",4951:"home.chunk",6250:"discover~settings.chunk",6438:"groups-page-media",6535:"discover.chunk",6740:"discover~memories.chunk",6791:"groups-page-members",7206:"groups-page-topics",7342:"groups-post",7399:"dms~message.chunk",7413:"error404.bundle",7521:"discover~findfriends.chunk",7744:"notifications.chunk",8087:"profile.chunk",8119:"i18n.bundle",8257:"groups-page-about",8408:"post.chunk",8977:"profile~followers.bundle",9124:"compose.chunk",9231:"groups-profile",9919:"changelog.bundle"}[e]+"."+{529:"2826b7d8bc08bf22",1179:"2e39a13fa12d0d01",1240:"fa7fd5597bfbf81c",1645:"30a324bbbe437db7",2156:"13a1bf15db918fb7",2822:"82affc4a7b5983b0",2966:"8118feb3b8e0cfc6",3688:"899d6ab4a7d0dd14",4951:"85664d23a3e0c64a",6250:"46eb9fa72bdbfafa",6438:"f3be2d8b0ca59cdf",6535:"0a3c5b36cedbad42",6740:"17874e2d9dfb4f00",6791:"a2d12bc765ad0f38",7206:"7bee36f3edc0de92",7342:"aca9f85bd8b36f70",7399:"ca55c5d89171edc4",7413:"c408e3fce0f80bcb",7521:"2d3007cfd414b33a",7744:"d2559e00a1a30220",8087:"3a9fd2df1fe88c48",8119:"9ffc0aacc1ff49e5",8257:"dfb2744b2a28d4c5",8408:"2b6bc0acfbfed17f",8977:"8381cac06885ce77",9124:"cb3781f6e49426e4",9231:"924132e02f73d082",9919:"f97c6c2fdd203b90"}[e]+".js",t.miniCssF=e=>({2305:"css/portfolio",2540:"css/landing",3364:"css/admin",4370:"css/profile",6952:"css/appdark",8252:"css/app",8759:"css/spa"}[e]+".css"),t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},o="pixelfed:",t.l=(e,a,d,n)=>{if(r[e])r[e].push(a);else{var c,s;if(void 0!==d)for(var i=document.getElementsByTagName("script"),f=0;f<i.length;f++){var l=i[f];if(l.getAttribute("src")==e||l.getAttribute("data-webpack")==o+d){c=l;break}}c||(s=!0,(c=document.createElement("script")).charset="utf-8",t.nc&&c.setAttribute("nonce",t.nc),c.setAttribute("data-webpack",o+d),c.src=e),r[e]=[a];var u=(o,a)=>{c.onerror=c.onload=null,clearTimeout(b);var d=r[e];if(delete r[e],c.parentNode&&c.parentNode.removeChild(c),d&&d.forEach(e=>e(a)),o)return o(a)},b=setTimeout(u.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=u.bind(null,c.onerror),c.onload=u.bind(null,c.onload),s&&document.head.appendChild(c)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.p="/",(()=>{var e={461:0,6952:0,8252:0,2305:0,3364:0,2540:0,4370:0,8759:0};t.f.j=(r,o)=>{var a=t.o(e,r)?e[r]:void 0;if(0!==a)if(a)o.push(a[2]);else if(/^((69|82)52|2305|2540|3364|4370|461|8759)$/.test(r))e[r]=0;else{var d=new Promise((o,d)=>a=e[r]=[o,d]);o.push(a[2]=d);var n=t.p+t.u(r),c=new Error;t.l(n,o=>{if(t.o(e,r)&&(0!==(a=e[r])&&(e[r]=void 0),a)){var d=o&&("load"===o.type?"missing":o.type),n=o&&o.target&&o.target.src;c.message="Loading chunk "+r+" failed.\n("+d+": "+n+")",c.name="ChunkLoadError",c.type=d,c.request=n,a[1](c)}},"chunk-"+r,r)}},t.O.j=r=>0===e[r];var r=(r,o)=>{var a,d,[n,c,s]=o,i=0;if(n.some(r=>0!==e[r])){for(a in c)t.o(c,a)&&(t.m[a]=c[a]);if(s)var f=s(t)}for(r&&r(o);i<n.length;i++)d=n[i],t.o(e,d)&&e[d]&&e[d][0](),e[d]=0;return t.O(f)},o=self.webpackChunkpixelfed=self.webpackChunkpixelfed||[];o.forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})(),t.nc=void 0})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -29,11 +29,11 @@
"/js/group-topic-feed.js": "/js/group-topic-feed.js?id=df12a95f1d1ba9c229ab921761fcd5ec",
"/js/custom_filters.js": "/js/custom_filters.js?id=f633fb6090aa4906678dc37b41f9f62d",
"/js/settings.js": "/js/settings.js?id=05d89311feefa503f2fa2272d1432b37",
"/js/manifest.js": "/js/manifest.js?id=48abfb686c2ea74b2671dcb0e05ab7ed",
"/js/home.chunk.e4af088f458b12ae.js": "/js/home.chunk.e4af088f458b12ae.js?id=785e3b2fcc4c9c507b11bba2a28c8c79",
"/js/manifest.js": "/js/manifest.js?id=5fdc69afa4f8eb701e9b05dc7b7696b2",
"/js/home.chunk.85664d23a3e0c64a.js": "/js/home.chunk.85664d23a3e0c64a.js?id=175488174ceca89c9427e662c91ab329",
"/js/compose.chunk.cb3781f6e49426e4.js": "/js/compose.chunk.cb3781f6e49426e4.js?id=6b6a69634e352106f17301a08df66b24",
"/js/post.chunk.fb5fcbe76fc9cc5f.js": "/js/post.chunk.fb5fcbe76fc9cc5f.js?id=6e2dd5e2d38a3a624e5f2326fff5eafb",
"/js/profile.chunk.08904b4d996ac4ad.js": "/js/profile.chunk.08904b4d996ac4ad.js?id=bb03cd3d3f8d466a717250a9fa3f67d6",
"/js/post.chunk.2b6bc0acfbfed17f.js": "/js/post.chunk.2b6bc0acfbfed17f.js?id=f1be09a0b1600e9031d99cb587c9b81f",
"/js/profile.chunk.3a9fd2df1fe88c48.js": "/js/profile.chunk.3a9fd2df1fe88c48.js?id=b1dfec94d7df6507f76c92e8cf628fee",
"/js/discover~memories.chunk.17874e2d9dfb4f00.js": "/js/discover~memories.chunk.17874e2d9dfb4f00.js?id=abf6caaaf2b65ef34ce15e122286cdc2",
"/js/discover~myhashtags.chunk.fa7fd5597bfbf81c.js": "/js/discover~myhashtags.chunk.fa7fd5597bfbf81c.js?id=1f9e7b47a3fb5025cecb93df689bc7f3",
"/js/daci.chunk.2e39a13fa12d0d01.js": "/js/daci.chunk.2e39a13fa12d0d01.js?id=1113068ab2c6045e96d80167fb0c3d95",
@ -46,7 +46,7 @@
"/js/dms~message.chunk.ca55c5d89171edc4.js": "/js/dms~message.chunk.ca55c5d89171edc4.js?id=3353b5344d9542fa0b1b67ec1253cc7a",
"/js/profile~followers.bundle.8381cac06885ce77.js": "/js/profile~followers.bundle.8381cac06885ce77.js?id=e5c9cfb367fe6a7697fd7f50ebd74f13",
"/js/profile~following.bundle.30a324bbbe437db7.js": "/js/profile~following.bundle.30a324bbbe437db7.js?id=fe94503194686408600e8750b32b08de",
"/js/discover~hashtag.bundle.43d7fefd51744728.js": "/js/discover~hashtag.bundle.43d7fefd51744728.js?id=ce2499cbb2f6f0a6d9a58ea761b6c7bd",
"/js/discover~hashtag.bundle.8118feb3b8e0cfc6.js": "/js/discover~hashtag.bundle.8118feb3b8e0cfc6.js?id=c9b62b7a6820a34066bdc6e9f9ed5650",
"/js/error404.bundle.c408e3fce0f80bcb.js": "/js/error404.bundle.c408e3fce0f80bcb.js?id=c416458981590b2ebe9fb35f5d3d1a6f",
"/js/i18n.bundle.9ffc0aacc1ff49e5.js": "/js/i18n.bundle.9ffc0aacc1ff49e5.js?id=447bbc12a507350e6aef265c54fbdab3",
"/js/changelog.bundle.f97c6c2fdd203b90.js": "/js/changelog.bundle.f97c6c2fdd203b90.js?id=6e5a3b62042ec170dd0bad0550176579",

@ -5,54 +5,41 @@
<div class="row justify-content-center">
<div class="col-12 col-md-6">
<div class="card shadow-none border card-body mt-5 mb-3 ft-std" style="border-radius: 20px;">
<p class="lead font-weight-bold text-center mb-0"><i class="far fa-exclamation-triangle mr-2"></i>This account has indicated their new account is:</p>
<p class="lead font-weight-bold text-center mb-0"><i
class="far fa-exclamation-triangle mr-2"></i>This account has indicated their new
account is:</p>
</div>
<div class="card shadow-none border" style="border-radius: 20px;">
<div class="card-body ft-std">
<div class="d-flex justify-content-between align-items-center" style="gap: 1rem;">
<div class="d-flex align-items-center flex-shrink-1" style="gap: 1rem;">
<img :src="profile.moved.avatar" width="50" height="50" class="rounded-circle" onerror="this.onerror=null;this.src='/storage/avatars/default.jpg?v=0';">
<p class="h3 font-weight-light mb-0 text-break">&commat;{{ profile.moved.acct }}</p>
<img :src="profile.moved.avatar" width="50" height="50" class="rounded-circle"
onerror="this.onerror=null;this.src='/storage/avatars/default.jpg?v=0';">
<p class="h3 font-weight-light mb-0 text-break">&commat;{{ profile.moved.acct }}
</p>
</div>
<div class="d-flex flex-grow-1 justify-content-end" style="min-width: 200px;">
<router-link
:to="`/i/web/profile/${profile.moved.id}`"
class="btn btn-outline-primary rounded-pill font-weight-bold"
>View New Account</router-link>
<router-link :to="`/i/web/profile/${profile.moved.id}`"
class="btn btn-outline-primary rounded-pill font-weight-bold">View New
Account</router-link>
</div>
</div>
</div>
</div>
<hr>
<p class="lead text-center ft-std">
<a
href="#"
class="btn btn-primary btn-lg rounded-pill font-weight-bold px-5"
@click.prevent="showMoved = true">Proceed</a>
</p>
</div>
</div>
</div>
<div v-else class="row">
<div class="col-md-3 d-md-block px-md-3 px-xl-5">
<profile-sidebar
:profile="profile"
:relationship="relationship"
:user="curUser"
v-on:back="goBack"
v-on:toggletab="toggleTab"
v-on:updateRelationship="updateRelationship"
@follow="follow"
<profile-sidebar :profile="profile" :relationship="relationship" :user="curUser" v-on:back="goBack"
v-on:toggletab="toggleTab" v-on:updateRelationship="updateRelationship" @follow="follow"
@unfollow="unfollow" />
</div>
<div class="col-md-8 px-md-5">
<component
v-bind:is="getTabComponentName()"
:key="getTabComponentName() + profile.id"
:profile="profile"
:relationship="relationship" />
<component v-bind:is="getTabComponentName()" :key="getTabComponentName() + profile.id"
:profile="profile" :relationship="relationship" />
</div>
</div>
@ -62,102 +49,102 @@
</template>
<script type="text/javascript">
import Drawer from './partials/drawer.vue';
import ProfileFeed from './partials/profile/ProfileFeed.vue';
import ProfileSidebar from './partials/profile/ProfileSidebar.vue';
import ProfileFollowers from './partials/profile/ProfileFollowers.vue';
import ProfileFollowing from './partials/profile/ProfileFollowing.vue';
export default {
props: {
id: {
type: String
},
profileId: {
type: String
},
username: {
type: String
},
cachedProfile: {
type: Object
},
cachedUser: {
type: Object
}
},
components: {
"drawer": Drawer,
"profile-feed": ProfileFeed,
"profile-sidebar": ProfileSidebar,
"profile-followers": ProfileFollowers,
"profile-following": ProfileFollowing
import Drawer from './partials/drawer.vue';
import ProfileFeed from './partials/profile/ProfileFeed.vue';
import ProfileSidebar from './partials/profile/ProfileSidebar.vue';
import ProfileFollowers from './partials/profile/ProfileFollowers.vue';
import ProfileFollowing from './partials/profile/ProfileFollowing.vue';
export default {
props: {
id: {
type: String
},
data() {
return {
isLoaded: false,
curUser: undefined,
tab: "index",
profile: undefined,
relationship: undefined,
showMoved: false,
}
profileId: {
type: String
},
mounted() {
this.init();
username: {
type: String
},
watch: {
'$route': 'init'
cachedProfile: {
type: Object
},
methods: {
init() {
this.tab = 'index';
this.isLoaded = false;
this.relationship = undefined;
this.owner = false;
if(this.cachedProfile && this.cachedUser) {
this.curUser = this.cachedUser;
this.profile = this.cachedProfile;
// this.fetchPosts();
// this.isLoaded = true;
this.fetchRelationship();
if(this.cachedProfile && this.cachedProfile.local) {
window.history.pushState({}, '', `/${this.cachedProfile.acct}`);
}
} else {
this.curUser = window._sharedData.user;
this.fetchProfile();
cachedUser: {
type: Object
}
},
components: {
"drawer": Drawer,
"profile-feed": ProfileFeed,
"profile-sidebar": ProfileSidebar,
"profile-followers": ProfileFollowers,
"profile-following": ProfileFollowing
},
data() {
return {
isLoaded: false,
curUser: undefined,
tab: "index",
profile: undefined,
relationship: undefined,
showMoved: false,
}
},
mounted() {
this.init();
},
watch: {
'$route': 'init'
},
methods: {
init() {
this.tab = 'index';
this.isLoaded = false;
this.relationship = undefined;
this.owner = false;
if (this.cachedProfile && this.cachedUser) {
this.curUser = this.cachedUser;
this.profile = this.cachedProfile;
// this.fetchPosts();
// this.isLoaded = true;
this.fetchRelationship();
if (this.cachedProfile && this.cachedProfile.local) {
window.history.pushState({}, '', `/${this.cachedProfile.acct}`);
}
},
} else {
this.curUser = window._sharedData.user;
this.fetchProfile();
}
},
getTabComponentName() {
switch(this.tab) {
case 'index':
return "profile-feed";
getTabComponentName() {
switch (this.tab) {
case 'index':
return "profile-feed";
break;
default:
return `profile-${this.tab}`;
default:
return `profile-${this.tab}`;
break;
}
},
}
},
fetchProfile() {
let id = this.profileId ? this.profileId : this.id;
axios.get('/api/pixelfed/v1/accounts/' + id)
fetchProfile() {
let id = this.profileId ? this.profileId : this.id;
axios.get('/api/pixelfed/v1/accounts/' + id)
.then(res => {
this.profile = res.data;
if(res.data.id == this.curUser.id) {
if (res.data.id == this.curUser.id) {
this.owner = true;
// this.isLoaded = true;
// this.loaded();
@ -168,46 +155,46 @@
this.fetchRelationship();
}
if(res.data && res.data.local) {
if (res.data && res.data.local) {
window.history.pushState({}, '', `/${res.data.acct}`);
}
})
.catch(err => {
this.$router.push('/i/web/404');
});
},
},
fetchRelationship() {
if(this.owner) {
this.relationship = {};
this.isLoaded = true;
return;
}
fetchRelationship() {
if (this.owner) {
this.relationship = {};
this.isLoaded = true;
return;
}
axios.get('/api/v1/accounts/relationships', {
params: {
'id[]': this.profile.id
}
}).then(res => {
this.relationship = res.data[0];
this.isLoaded = true;
})
},
axios.get('/api/v1/accounts/relationships', {
params: {
'id[]': this.profile.id
}
}).then(res => {
this.relationship = res.data[0];
this.isLoaded = true;
})
},
toggleTab(tab) {
this.tab = tab;
},
toggleTab(tab) {
this.tab = tab;
},
goBack() {
this.$router.go(-1);
},
goBack() {
this.$router.go(-1);
},
unfollow() {
axios.post('/api/v1/accounts/' + this.profile.id + '/unfollow')
unfollow() {
axios.post('/api/v1/accounts/' + this.profile.id + '/unfollow')
.then(res => {
this.$store.commit('updateRelationship', [res.data])
this.relationship = res.data;
if(this.profile.locked) {
if (this.profile.locked) {
location.reload();
}
this.profile.followers_count--;
@ -215,14 +202,14 @@
swal('Oops!', 'An error occured when attempting to unfollow this account.', 'error');
this.relationship.following = true;
});
},
},
follow() {
axios.post('/api/v1/accounts/' + this.profile.id + '/follow')
follow() {
axios.post('/api/v1/accounts/' + this.profile.id + '/follow')
.then(res => {
this.$store.commit('updateRelationship', [res.data])
this.relationship = res.data;
if(this.profile.locked) {
if (this.profile.locked) {
this.relationship.requested = true;
}
this.profile.followers_count++;
@ -230,17 +217,17 @@
swal('Oops!', 'An error occured when attempting to follow this account.', 'error');
this.relationship.following = false;
});
},
},
updateRelationship(val) {
this.relationship = val;
}
updateRelationship(val) {
this.relationship = val;
}
}
}
</script>
<style lang="scss" scoped>
.profile-timeline-component {
margin-bottom: 10rem;
}
.profile-timeline-component {
margin-bottom: 10rem;
}
</style>

Loading…
Cancel
Save