We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad62677 commit bb8e622Copy full SHA for bb8e622
1 file changed
frontend/src/components/app/users/User.vue
@@ -35,6 +35,16 @@ export default {
35
goBack() {
36
this.$router.go(-1);
37
},
38
+ sortImages() {
39
+ const userImagesLength = this.user.images.length;
40
+ for (let i = 0; i < userImagesLength; i += 1) {
41
+ if (this.user.images[i].is_primary && i !== 0) {
42
+ this.user.images.splice(0, 0, this.user.images[i]);
43
+ this.user.images.splice(i + 1, 1);
44
+ return;
45
+ }
46
47
+ },
48
49
watch: {
50
async $route() {
@@ -46,6 +56,7 @@ export default {
56
try {
57
const userRequest = await this.$http.get(`/profile/view/${this.$route.params.id}`, { accessTokenRequired: true });
58
this.user = userRequest.data.profile;
59
+ this.sortImages();
60
} catch (error) {
61
this.error = error.response.data.error.message;
51
62
}
0 commit comments