mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 12:53:43 +01:00 
			
		
		
		
	fix https://github.com/go-gitea/gitea/issues/32226 in https://github.com/go-gitea/gitea/pull/27775 , it do some changes to only show diff file tree when more than one file changed. But looks it also break the `diff-file-list` logic, which looks not expected change. so try fix it. /cc @silverwind example view:  Signed-off-by: a1012112796 <1012112796@qq.com>
		
			
				
	
	
		
			20 lines
		
	
	
		
			568 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			568 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import {createApp} from 'vue';
 | 
						|
import DiffFileTree from '../components/DiffFileTree.vue';
 | 
						|
import DiffFileList from '../components/DiffFileList.vue';
 | 
						|
 | 
						|
export function initDiffFileTree() {
 | 
						|
  const el = document.querySelector('#diff-file-tree');
 | 
						|
  if (!el) return;
 | 
						|
 | 
						|
  const fileTreeView = createApp(DiffFileTree);
 | 
						|
  fileTreeView.mount(el);
 | 
						|
}
 | 
						|
 | 
						|
export function initDiffFileList() {
 | 
						|
  const fileListElement = document.querySelector('#diff-file-list');
 | 
						|
  if (!fileListElement) return;
 | 
						|
 | 
						|
  const fileListView = createApp(DiffFileList);
 | 
						|
  fileListView.mount(fileListElement);
 | 
						|
}
 |