File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,15 @@ export default {
8888 const matchesRequest = await this .$http .get (' /matches' );
8989 const { matches } = matchesRequest .data ;
9090 for (let i = 0 ; i < matches .length ; i += 1 ) {
91- for (let j = 0 ; j < this .messages .length ; j += 1 ) {
92- if (this .messages [j].length && this .messages [j][0 ].to_id !== matches[i].user_1 ) {
93- const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
94- this .matches .push (userRequest .data );
91+ if (! this .messages .length ) {
92+ const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
93+ this .matches .push (userRequest .data );
94+ } else {
95+ for (let j = 0 ; j < this .messages .length ; j += 1 ) {
96+ if (this .messages [j][0 ].to_id !== matches[i].user_1 ) {
97+ const userRequest = await this .$http .get (` /users/${ matches[i].user_1 } ` );
98+ this .matches .push (userRequest .data );
99+ }
95100 }
96101 }
97102 }
You can’t perform that action at this time.
0 commit comments