Skip to content

Commit

Permalink
Potentially fix application stuck when Navidrome credential expires (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffvli committed Mar 13, 2024
1 parent 854b767 commit d806ade
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/renderer/api/navidrome/navidrome-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 = [
{
Expand Down Expand Up @@ -50,7 +50,6 @@ const ActionRequiredRoute = () => {
<Stack mt="2rem">
{canReturnHome && (
<>
<Navigate to={AppRoute.HOME} />
<Group
noWrap
position="center"
Expand Down

0 comments on commit d806ade

Please sign in to comment.