mirror of
https://github.com/hpware/news-analyze.git
synced 2025-06-23 13:04:23 +00:00
Add validate user & optimize code from coderabbit via PR #6
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
Some checks are pending
Build and Push Beta Image / build-and-push (push) Waiting to run
This commit is contained in:
parent
b862f4cdb0
commit
ad0f13a1a2
3 changed files with 19 additions and 2 deletions
|
@ -81,7 +81,11 @@ const updateContent = async (url: string, tabAction: boolean) => {
|
|||
const req = await fetch(`/api/home/lt?query=${url.trim()}`);
|
||||
const data = await req.json();
|
||||
if (data) {
|
||||
const coolArray = [...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,
|
||||
|
|
|
@ -43,6 +43,11 @@ const validateUserInfo = async () => {
|
|||
isLoggedIn.value = true;
|
||||
};
|
||||
|
||||
const intervalTime = 1000 * 60 * 2; // Validate user Info for every ten min while the admin page is opened.
|
||||
setInterval(async () => {
|
||||
await validateUserInfo();
|
||||
}, intervalTime);
|
||||
|
||||
const emit = defineEmits(["windowopener"]);
|
||||
|
||||
const logoutAction = async () => {
|
||||
|
@ -96,6 +101,7 @@ const showDeleteDialog = ref(false);
|
|||
const showLogoutDialog = ref(false);
|
||||
const confirmDelete = async () => {
|
||||
await deleteAccount();
|
||||
await validateUserInfo();
|
||||
showDeleteDialog.value = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -132,7 +132,14 @@ useSeoMeta({
|
|||
<TooltipProvider>
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<NuxtLink :to="localePath('/desktop?openapp=onboard')">
|
||||
<NuxtLink
|
||||
:to="
|
||||
localePath({
|
||||
path: '/desktop',
|
||||
query: { openapp: 'onboard' },
|
||||
})
|
||||
"
|
||||
>
|
||||
<button
|
||||
class="m-4 mr-1 ml-1 bg-[#8C9393] text-white p-3 rounded-[10px] bg-gradient-to-l from-sky-500 to-purple-600 transition-all duration-150 hover:transform hover:scale-105 hover:shadow-lg"
|
||||
>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue