Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
chore(react): fix editorconfig
Elian Doran4891721cc061
diff --git a/.editorconfig b/.editorconfigindex cd301498ec..cebb2ba580 100644--- a/.editorconfig+++ b/.editorconfig@@ -1,6 +1,6 @@root = true-[*.{js,ts,.tsx}]+[*.{js,ts,tsx}]charset = utf-8end_of_line = lfindent_size = 4diff --git a/apps/client/src/widgets/collections/Pagination.tsx b/apps/client/src/widgets/collections/Pagination.tsxindex 9d4782da4d..435f9049bf 100644--- a/apps/client/src/widgets/collections/Pagination.tsx+++ b/apps/client/src/widgets/collections/Pagination.tsx@@ -33,10 +33,10 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<Ptitle={t("pagination.page_title", { startIndex, endIndex })}onClick={() => setPage(i)}>- {i}+ {i}</a>))- } else {+ } else {// Current pagechildren.push(<span className="current-page">{i}</span>)}@@ -52,6 +52,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<P<div class="note-list-pager">{children}+ // no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all<span className="note-list-pager-total-count">({t("pagination.total_notes", { count: totalNotes })})</span></div>)@@ -59,7 +60,7 @@ export function Pager({ page, pageSize, setPage, pageCount, totalNotes }: Omit<Pexport function usePagination(note: FNote, noteIds: string[]): PaginationContext {const [ page, setPage ] = useState(1);- const [ pageNotes, setPageNotes ] = useState<FNote[]>();+ const [ pageNotes, setPageNotes ] = useState<FNote[]>();// Parse page size.const [ pageSize ] = useNoteLabel(note, "pageSize");@@ -72,7 +73,7 @@ export function usePagination(note: FNote, noteIds: string[]): PaginationContextconst pageCount = Math.ceil(noteIds.length / normalizedPageSize);// Obtain notes within the range.- const pageNoteIds = noteIds.slice(startIdx, Math.min(endIdx, noteIds.length));+ const pageNoteIds = noteIds.slice(startIdx, Math.min(endIdx, noteIds.length));useEffect(() => {froca.getNotes(pageNoteIds).then(setPageNotes);@@ -83,4 +84,4 @@ export function usePagination(note: FNote, noteIds: string[]): PaginationContextpageSize: normalizedPageSize,totalNotes: noteIds.length};-}\ No newline at end of file+}diff --git a/apps/client/src/widgets/view_widgets/list_or_grid_view.ts b/apps/client/src/widgets/view_widgets/list_or_grid_view.tsindex 8e88ebdcf9..0b1d6b5798 100644--- a/apps/client/src/widgets/view_widgets/list_or_grid_view.ts+++ b/apps/client/src/widgets/view_widgets/list_or_grid_view.ts@@ -39,19 +39,9 @@ class ListOrGridView extends ViewMode<{}> {this.$noteList.show();- this.renderPager();-return this.$noteList;}- renderPager() {---- // no need to distinguish "note" vs "notes" since in case of one result, there's no paging at all- $pager.append(`<span class=""></span>`);- }-async renderNote(note: FNote, expand: boolean = false) {const { $renderedAttributes } = await attributeRenderer.renderNormalAttributes(note);