File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -89,11 +89,19 @@ export default {
8989 const { matches } = matchesRequest .data ;
9090 for (let i = 0 ; i < matches .length ; i += 1 ) {
9191 if (! this .messages .length ) {
92- const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
93- this .matches .push (userRequest .data );
92+ if (this .$store .getters .getLoggedInUser .id === matches[i].user_1 ) {
93+ const userRequest = await this .$http .get (` /users/${ matches[i].user_2 } ` );
94+ this .matches .push (userRequest .data );
95+ } else {
96+ const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
97+ this .matches .push (userRequest .data );
98+ }
9499 } else {
95100 for (let j = 0 ; j < this .messages .length ; j += 1 ) {
96- if (this .messages [j][0 ].to_id !== matches[i].user_1 ) {
101+ if (this .$store .getters .getLoggedInUser .id === matches[i].user_1 ) {
102+ const userRequest = await this .$http .get (` /users/${ matches[i].user_2 } ` );
103+ this .matches .push (userRequest .data );
104+ } else {
97105 const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
98106 this .matches .push (userRequest .data );
99107 }
You can’t perform that action at this time.
0 commit comments