You can contribute to our website development or add your
documents and user account to eeXiv on our{' '}
-
+
GitHub repository
.
diff --git a/src/app/author/[author]/AuthorDisplay.tsx b/src/app/author/[author]/AuthorDisplay.tsx
index 81e73c7..d1206cf 100644
--- a/src/app/author/[author]/AuthorDisplay.tsx
+++ b/src/app/author/[author]/AuthorDisplay.tsx
@@ -178,10 +178,10 @@ export default function AuthorDisplay({
))}
-
-
{authorsDocuments.length > 0 && (
<>
+
+
Published documents
diff --git a/src/app/components/News.tsx b/src/app/components/News.tsx
index 1902c2d..710a794 100644
--- a/src/app/components/News.tsx
+++ b/src/app/components/News.tsx
@@ -31,14 +31,21 @@ export default function News() {
eeXiv is currently under active development! There may be major
updates, breaking changes, or weird bugs. Report bugs, suggest new
features, or give us feedback at{' '}
-
+
our issue tracker.
Want to upload your documents or just make yourself a profile on
- eeXiv? Check our about page for more
- information!
+ eeXiv? Check our{' '}
+
+ about page
+ {' '}
+ for more information!
diff --git a/src/app/db/data.ts b/src/app/db/data.ts
index 42163a9..73848b6 100644
--- a/src/app/db/data.ts
+++ b/src/app/db/data.ts
@@ -1,31 +1,3 @@
-/*
-documents db schema
-documents {
- slug: {
- manifest: {
- title: string
- authors: string[]
- date: unix epoch integer[] -> if multiple revisions, put the earlier dates first
- type: presentation | report | whitepaper | other
- latest: integer >= 1 -> the latest revision of the document (earliest = 1)
- keywords: string[]
- topics: string[]
- references: string[],
- code: url[]
- },
- abstract: string,
- file: pdf | docx | pptx | targz | other, named file[rev].[ext]
- (eg. revision 1 = file1.pdf, revision 2 = file2.pdf, etc)
- the "latest" should be the latest revision
- citation: a string that can be used to cite the document
- reviewers: an array of reviewers, following the reviewer format. if you specify a local
- profile username, it will link to the author's profile, and take priority over the link
- status: draft | under review | reviewed | published no review
- note: published no review should be used for documents where peer review
- is not appropriate or unnecessary
- }
-}
-*/
export type FileType = 'pdf' | 'docx' | 'pptx' | 'tar.gz' | 'other'
export type DocumentType =
| 'presentation'
@@ -42,11 +14,13 @@ export type reviewer = {
profile?: string
url?: string
}
+
export type DocumentStatus =
| 'draft'
| 'under review'
| 'reviewed'
| 'published no review'
+
export interface Document {
manifest: DocumentManifest
abstract: string
diff --git a/src/app/db/loaders.ts b/src/app/db/loaders.ts
index 2af5727..4e40eec 100644
--- a/src/app/db/loaders.ts
+++ b/src/app/db/loaders.ts
@@ -83,16 +83,15 @@ export const loadAllAuthors = (): Promise<{ [key: string]: Author }> => {
worker.postMessage('LOAD')
} else {
- reject(
- new Error(
- 'Web Workers are not supported in this environment. Please avoid using a prehistoric browser.'
- )
- )
+ return
}
})
}
-export const loadAuthor = (id: string): Promise => {
+export const loadAuthors = (
+ authorIds: string[]
+): Promise<{ [key: string]: Author }> => {
+ 'use client'
return new Promise((resolve, reject) => {
if (typeof Worker !== 'undefined') {
const worker = new Worker(
@@ -101,12 +100,10 @@ export const loadAuthor = (id: string): Promise => {
)
worker.onmessage = (e: MessageEvent<{ [key: string]: Author }>) => {
- const data = e.data
- const author: Author | undefined = data[id]
- if (!author) {
- return reject(new Error('404'))
+ if (typeof e.data === 'object' && Object.keys(e.data).length > 0) {
+ resolve(e.data)
} else {
- resolve(author)
+ reject(new Error('404'))
}
worker.terminate()
}
@@ -116,7 +113,7 @@ export const loadAuthor = (id: string): Promise => {
worker.terminate()
}
- worker.postMessage('LOAD')
+ worker.postMessage(authorIds)
} else {
reject(
new Error(
diff --git a/src/app/db/workers/authorLoader.worker.ts b/src/app/db/workers/authorLoader.worker.ts
index 4ec63fe..0509ee4 100644
--- a/src/app/db/workers/authorLoader.worker.ts
+++ b/src/app/db/workers/authorLoader.worker.ts
@@ -1,7 +1,30 @@
-import { authors } from '../data'
+import { authors, Author } from '../data'
+
+export function getAuthorsById(authorIds: string[]): { [key: string]: Author } {
+ const result: { [key: string]: Author } = {}
+
+ // Iterate through the array of author IDs
+ for (const id of authorIds) {
+ const author = authors[id] // Retrieve the author entry by ID
+ if (author) {
+ result[id] = author // If the author exists, add it to the result object
+ }
+ }
+
+ return result
+}
+
+const checkIsStringArray = (data: unknown): data is string[] => {
+ if (Array.isArray(data)) {
+ return data.every((d) => typeof d === 'string')
+ }
+ return false
+}
onmessage = (e) => {
- if (e.data === 'LOAD') {
- self.postMessage(authors)
- }
+ let authorIds: string[] = []
+ checkIsStringArray(e.data) && (authorIds = e.data as string[])
+ let results = getAuthorsById(authorIds)
+
+ postMessage(results)
}
diff --git a/src/app/document/page.tsx b/src/app/document/page.tsx
deleted file mode 100644
index 0b7b6ad..0000000
--- a/src/app/document/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function Page() {
- return (
-
- This is a placeholder for a document browser that will be implemented in
- the future. In the meantime, you can view specific documents by searching.
-
If you encounter any accessibility-related issues related to your use of
our site, it is likely because of our jank code architecture.
diff --git a/src/app/legal/copyright/page.tsx b/src/app/legal/copyright/page.tsx
index 8c75ebd..88a94ca 100644
--- a/src/app/legal/copyright/page.tsx
+++ b/src/app/legal/copyright/page.tsx
@@ -2,7 +2,9 @@ import Link from 'next/link'
export default function Page() {
return (
We currently do not have the technical support to implement mailing
lists in eeXiv. Check back later for updates. The best way to stay
diff --git a/src/app/utils/epoch2datestring.ts b/src/app/utils/epoch2datestring.ts
index f595cff..e93b144 100644
--- a/src/app/utils/epoch2datestring.ts
+++ b/src/app/utils/epoch2datestring.ts
@@ -11,3 +11,7 @@ export function epoch2datestring(epoch: number): string {
return formattedDate
}
+
+export function epoch2date(epoch: number): Date {
+ return new Date(epoch * 1000)
+}