fix: Do update the terms correctly (oops)
This commit is contained in:
		
							parent
							
								
									0ac5d035a2
								
							
						
					
					
						commit
						64d5381d1e
					
				| 
						 | 
				
			
			@ -67,10 +67,10 @@ class Note
 | 
			
		|||
        $note->mediaInfo = $note->parseMediaInfo($note->fields['Notes']);
 | 
			
		||||
 | 
			
		||||
        // Set VocabKanji field
 | 
			
		||||
        $terms = Term::fromNoteFields($note->fields);
 | 
			
		||||
        $note->terms = Term::fromNoteFields($note->fields);
 | 
			
		||||
 | 
			
		||||
        // If not defined, find them from the highlighted parts in the sentence
 | 
			
		||||
        if (empty($terms)) {
 | 
			
		||||
        if (empty($note->terms)) {
 | 
			
		||||
            // 1. Get all spans in the text
 | 
			
		||||
            preg_match_all(
 | 
			
		||||
                self::HIGHLIGHT_PATTERN,
 | 
			
		||||
| 
						 | 
				
			
			@ -90,8 +90,6 @@ class Note
 | 
			
		|||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (empty($terms)) dd($note);
 | 
			
		||||
 | 
			
		||||
        // Set to null whatever is null
 | 
			
		||||
        $readings = array_map(
 | 
			
		||||
            fn($x) => in_array($x, ['_', '_', '']) ? null : $x,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue