fedimbed: fix another gts moment (emotes not being array)
This commit is contained in:
		
							parent
							
								
									a7c17c195b
								
							
						
					
					
						commit
						79cf9b9be7
					
				
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -408,10 +408,14 @@ async function processUrl(msg, url, spoiler = false) {
 | 
			
		|||
    cw = postData.summary;
 | 
			
		||||
    timestamp = postData.published;
 | 
			
		||||
 | 
			
		||||
    if (postData.tag)
 | 
			
		||||
      emotes = postData.tag
 | 
			
		||||
    if (postData.tag) {
 | 
			
		||||
      let tag = postData.tag;
 | 
			
		||||
      // gts moment
 | 
			
		||||
      if (!Array.isArray(tag)) tag = [tag];
 | 
			
		||||
      emotes = tag
 | 
			
		||||
        .filter((x) => !!x.icon)
 | 
			
		||||
        .map((x) => ({name: x.name, url: x.icon.url}));
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // NB: gts doesnt send singular attachments as areay
 | 
			
		||||
    const attachments = Array.isArray(postData.attachment)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue