Fix: Show all books in link creation modal
- Modified loadAvailableBooks() to include source document's book - Removed source book exclusion logic that was hiding current book - Now displays all available books instead of just 'other books' - Improves user experience by allowing links within same book Changes: - viewer-core.js: Removed bookMap.delete(sourceBookInfo.id) logic - Updated console logs to reflect 'all books' instead of 'other books' Result: All books now appear in the book selection dropdown
This commit is contained in:
@@ -511,23 +511,10 @@ window.documentViewer = () => ({
|
||||
|
||||
console.log('📚 그룹화된 모든 서적들:', Array.from(bookMap.values()));
|
||||
|
||||
// 소스 문서 기준으로 서적 분류
|
||||
if (sourceBookInfo.id) {
|
||||
// 소스 서적 제외 (다른 서적만 남김)
|
||||
const wasDeleted = bookMap.delete(sourceBookInfo.id);
|
||||
console.log('✅ 소스 서적 제외 결과:', {
|
||||
sourceBookId: sourceBookInfo.id,
|
||||
sourceBookTitle: sourceBookInfo.title,
|
||||
wasDeleted: wasDeleted,
|
||||
remainingBooks: bookMap.size
|
||||
});
|
||||
} else {
|
||||
console.warn('⚠️ 소스 문서의 서적 정보를 찾을 수 없습니다!');
|
||||
}
|
||||
|
||||
// 모든 서적 표시 (소스 서적 포함)
|
||||
this.availableBooks = Array.from(bookMap.values());
|
||||
console.log('📚 최종 사용 가능한 서적들 (다른 서적):', this.availableBooks);
|
||||
console.log('🔍 제외된 소스 서적 ID:', sourceBookInfo.id);
|
||||
console.log('📚 최종 사용 가능한 서적들 (모든 서적):', this.availableBooks);
|
||||
console.log('📖 소스 서적 정보 (포함됨):', sourceBookInfo);
|
||||
} catch (error) {
|
||||
console.error('서적 목록 로드 실패:', error);
|
||||
this.availableBooks = [];
|
||||
|
||||
Reference in New Issue
Block a user