add queryClient.clear() for logout
This commit is contained in:
@@ -49,7 +49,6 @@ export function MonitoringDropDown({ file }: {
|
|||||||
}, [dropdownRef, setIsOpen, isOpen]);
|
}, [dropdownRef, setIsOpen, isOpen]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(file);
|
|
||||||
if (file.status) {
|
if (file.status) {
|
||||||
setCurrentMonitoringStatus(file.status === 'ACTIVE' ? 'without-monitoring' : 'without-monitoring');
|
setCurrentMonitoringStatus(file.status === 'ACTIVE' ? 'without-monitoring' : 'without-monitoring');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import { FileMonitoringModalWindow } from '@/app/ui/modal-windows/file-monitorin
|
|||||||
import { FileTypeIcon } from '@/app/components/FileTypeIcon';
|
import { FileTypeIcon } from '@/app/components/FileTypeIcon';
|
||||||
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
||||||
import { MonitoringDropDown } from '@/app/components/tanstak-table/MonitoringDropDown';
|
import { MonitoringDropDown } from '@/app/components/tanstak-table/MonitoringDropDown';
|
||||||
|
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
||||||
|
|
||||||
type FileType = 'image' | 'video' | 'audio';
|
type FileType = 'image' | 'video' | 'audio';
|
||||||
|
|
||||||
@@ -582,7 +583,7 @@ export default function TanstakFilesTable({ fileType }: { fileType: string }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}, [tableData, typeFilter, dateFilter]);
|
}, [tableData, typeFilter, dateFilter]); //tut
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const currentPageRows = table.getRowModel().rows;
|
const currentPageRows = table.getRowModel().rows;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { convertBytes } from '@/app/lib/convertBytes';
|
|||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
import { getSessionData } from '@/app/actions/session';
|
||||||
|
|
||||||
type FileItem = {
|
type FileItem = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ import Link from 'next/link';
|
|||||||
import { logout } from '@/app/actions/auth';
|
import { logout } from '@/app/actions/auth';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
||||||
|
import { useQueryClient } from '@tanstack/react-query';
|
||||||
|
|
||||||
export default function UserMenuButton() {
|
export default function UserMenuButton() {
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
const menuRef = useRef<HTMLDivElement | null>(null);
|
const menuRef = useRef<HTMLDivElement | null>(null);
|
||||||
const t = useTranslations("Global");
|
const t = useTranslations("Global");
|
||||||
const { data: userData, isLoading, isError, error } = useUserProfile();
|
const { data: userData, isLoading, isError, error } = useUserProfile();
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
useClickOutside(
|
useClickOutside(
|
||||||
menuRef,
|
menuRef,
|
||||||
@@ -84,9 +86,10 @@ export default function UserMenuButton() {
|
|||||||
<Link
|
<Link
|
||||||
href="/"
|
href="/"
|
||||||
className="user-menu-logout"
|
className="user-menu-logout"
|
||||||
onClick={(e) => {
|
onClick={async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
logout();
|
queryClient.clear();
|
||||||
|
await logout();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { useSideMenuStore } from '@/app/stores/sideMenuStore';
|
|||||||
import { useRef } from 'react';
|
import { useRef } from 'react';
|
||||||
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
||||||
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
||||||
import { env } from 'process';
|
import { env } from 'process';
|
||||||
import { getBuildData } from '@/app/actions/action';
|
import { getBuildData } from '@/app/actions/action';
|
||||||
|
|
||||||
@@ -81,6 +81,7 @@ export default function NavLinks() {
|
|||||||
const setMenuState = useSideMenuStore(s => s.setValue);
|
const setMenuState = useSideMenuStore(s => s.setValue);
|
||||||
const menuState = useSideMenuStore(s => s.value);
|
const menuState = useSideMenuStore(s => s.value);
|
||||||
const links = navigation;
|
const links = navigation;
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const sideMenuRef = useRef<HTMLDivElement>(null)
|
const sideMenuRef = useRef<HTMLDivElement>(null)
|
||||||
useClickOutside(
|
useClickOutside(
|
||||||
@@ -162,10 +163,11 @@ export default function NavLinks() {
|
|||||||
key={t('exit')}
|
key={t('exit')}
|
||||||
href='/login'
|
href='/login'
|
||||||
className="flex nav-link"
|
className="flex nav-link"
|
||||||
onClick={(e) => {
|
onClick={async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
setMenuState(false);
|
setMenuState(false);
|
||||||
logout();
|
queryClient.clear();
|
||||||
|
await logout();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<svg viewBox="0 0 24 24" fill="currentColor">
|
<svg viewBox="0 0 24 24" fill="currentColor">
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
import styles from '@/app/styles/module/login.module.scss';
|
import styles from '@/app/styles/module/login.module.scss';
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useActionState, useEffect, useRef, useState, ChangeEvent } from 'react';
|
import { useActionState, useEffect, useRef, useState, ChangeEvent } from 'react';
|
||||||
import { getUserData } from '@/app/actions/action';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { companyUserRegistration } from '@/app/actions/companyActions';
|
import { companyUserRegistration } from '@/app/actions/companyActions';
|
||||||
import { CompanyUserRegistrationFormState } from '@/app/actions/companyActions';
|
import { CompanyUserRegistrationFormState } from '@/app/actions/companyActions';
|
||||||
import { SignupFormSchema } from '@/app/actions/definitions';
|
import { SignupFormSchema } from '@/app/actions/definitions';
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { useActionState, useState, useEffect } from 'react';
|
import { useActionState, useState, useEffect } from 'react';
|
||||||
import { getUserData } from '@/app/actions/action';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
||||||
|
|
||||||
export default function PersonalDataSettings() {
|
export default function PersonalDataSettings() {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useTranslations } from 'next-intl';
|
import { useTranslations } from 'next-intl';
|
||||||
import { getUserData } from '@/app/actions/action';
|
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { convertBytes } from '@/app/lib/convertBytes';
|
import { convertBytes } from '@/app/lib/convertBytes';
|
||||||
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
import { useUserProfile } from '@/app/hooks/react-query/useUserDataInfo';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user