Potentially fix application stuck when Navidrome credential expires (#538)

This commit is contained in:
jeffvli 2024-03-12 23:59:35 -07:00
parent 854b76702b
commit d806ade84c
2 changed files with 6 additions and 6 deletions

View File

@ -286,9 +286,10 @@ axiosClient.interceptors.response.use(
});
const serverId = currentServer.id;
useAuthStore
.getState()
.actions.updateServer(serverId, { ndCredential: undefined });
useAuthStore.getState().actions.updateServer(serverId, {
credential: undefined,
ndCredential: undefined,
});
useAuthStore.getState().actions.setCurrentServer(null);
// special error to prevent sending a second message, and stop other messages that could be enqueued

View File

@ -1,7 +1,7 @@
import { Center, Group, Stack } from '@mantine/core';
import { useTranslation } from 'react-i18next';
import { RiCheckFill } from 'react-icons/ri';
import { Link, Navigate } from 'react-router-dom';
import { Link } from 'react-router-dom';
import { Button, PageHeader, Text } from '/@/renderer/components';
import { ActionRequiredContainer } from '/@/renderer/features/action-required/components/action-required-container';
import { ServerCredentialRequired } from '/@/renderer/features/action-required/components/server-credential-required';
@ -14,7 +14,7 @@ const ActionRequiredRoute = () => {
const { t } = useTranslation();
const currentServer = useCurrentServer();
const isServerRequired = !currentServer;
const isCredentialRequired = false;
const isCredentialRequired = currentServer && !currentServer.credential;
const checks = [
{
@ -50,7 +50,6 @@ const ActionRequiredRoute = () => {
<Stack mt="2rem">
{canReturnHome && (
<>
<Navigate to={AppRoute.HOME} />
<Group
noWrap
position="center"