wip
This commit is contained in:
		
							parent
							
								
									671c5e7c12
								
							
						
					
					
						commit
						6df010a71e
					
				
					 1 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
					@ -262,7 +262,7 @@ export const pack = async (
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Populate media
 | 
						// Populate media
 | 
				
			||||||
	if (_note.mediaIds) {
 | 
						if (_note.mediaIds && !hide) {
 | 
				
			||||||
		_note.media = Promise.all(_note.mediaIds.map(fileId =>
 | 
							_note.media = Promise.all(_note.mediaIds.map(fileId =>
 | 
				
			||||||
			packFile(fileId)
 | 
								packFile(fileId)
 | 
				
			||||||
		));
 | 
							));
 | 
				
			||||||
| 
						 | 
					@ -321,7 +321,7 @@ export const pack = async (
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		// Poll
 | 
							// Poll
 | 
				
			||||||
		if (meId && _note.poll) {
 | 
							if (meId && _note.poll && !hide) {
 | 
				
			||||||
			_note.poll = (async (poll) => {
 | 
								_note.poll = (async (poll) => {
 | 
				
			||||||
				const vote = await PollVote
 | 
									const vote = await PollVote
 | 
				
			||||||
					.findOne({
 | 
										.findOne({
 | 
				
			||||||
| 
						 | 
					@ -362,5 +362,12 @@ export const pack = async (
 | 
				
			||||||
	// resolve promises in _note object
 | 
						// resolve promises in _note object
 | 
				
			||||||
	_note = await rap(_note);
 | 
						_note = await rap(_note);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (hide) {
 | 
				
			||||||
 | 
							_note.mediaIds = [];
 | 
				
			||||||
 | 
							_note.text = null;
 | 
				
			||||||
 | 
							_note.poll = null;
 | 
				
			||||||
 | 
							_note.isHidden = true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return _note;
 | 
						return _note;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue