diff --git a/.github/funding.yml b/.github/funding.yml new file mode 100644 index 0000000..b2ced52 --- /dev/null +++ b/.github/funding.yml @@ -0,0 +1 @@ +ko_fi: howard00 diff --git a/README.md b/README.md index df40a9b..322db69 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Video Guide: [YouTube](https://youtu.be/8P3qgVm6m6g) ## Demo: Production (Latest Docker Image): https://yhw.tw/news -Beta (Beta Docekr Image): https://newsbeta.20090526.xyz +Beta (Beta Docker Image): https://newsbeta.20090526.xyz ## Video Guide diff --git a/components/app/windows/news.vue b/components/app/windows/news.vue index cb82713..8ce825a 100644 --- a/components/app/windows/news.vue +++ b/components/app/windows/news.vue @@ -81,7 +81,15 @@ const updateContent = async (url: string, tabAction: boolean) => { const req = await fetch(`/api/home/lt?query=${url.trim()}`); const data = await req.json(); if (data) { - contentArray.value = [...data.uuidData, ...(data.nuuiddata?.items || [])]; + // Made by coderabbit: https://github.com/hpware/news-analyze/pull/6#discussion_r2144713017 + const coolArray = [ + ...(data.uuidData ?? []), + ...(data.nuuiddata?.items ?? []), + ]; + contentArray.value = + coolArray.sort( + (title1, title2) => title2.publishTimeUnix - title1.publishTimeUnix, + ) || []; switchTabs.value = false; isDataCached.value = data.cached || false; displayTranslateContent.value = false; diff --git a/components/app/windows/newsView.vue b/components/app/windows/newsView.vue index 32a3354..8b0fff2 100644 --- a/components/app/windows/newsView.vue +++ b/components/app/windows/newsView.vue @@ -1,6 +1,11 @@ diff --git a/createDatabase.ts b/createDatabase.ts index 4ebc340..b4959e4 100644 --- a/createDatabase.ts +++ b/createDatabase.ts @@ -54,9 +54,9 @@ const createSources = await sql` const createArticlesArchive = await sql` create table if not exists news_articles ( uuid text primary key, - article_id text primary key, + article_id text, jsondata json not null, - archive_timestamp timestamp default CURRENT_TIMESTAMP, + archive_timestamp timestamp default CURRENT_TIMESTAMP ) `; diff --git a/pages/desktop.vue b/pages/desktop.vue index dcc127d..04c70bf 100644 --- a/pages/desktop.vue +++ b/pages/desktop.vue @@ -374,7 +374,9 @@ onMounted(async () => { if (openApp.value === "newsView") { return; } - openWindow(openApp.value); + setTimeout(() => { + openWindow(openApp.value); + }, 2000); } }); diff --git a/pages/home.vue b/pages/home.vue index bbe7524..5b4cb0f 100644 --- a/pages/home.vue +++ b/pages/home.vue @@ -132,7 +132,14 @@ useSeoMeta({ - +