Skip to content

Commit

Permalink
fix: no longer shows an auth error when you first login (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
kristenmills authored Aug 23, 2020
1 parent 8e1a3a4 commit 85b4a3e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/core/layout/SideNav/hooks.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { useEffect, useState } from 'react';
import { useFlexgetAPI } from 'core/api';
import { createContainer } from 'unstated-next';
import { createContainer, useContainer } from 'unstated-next';
import { AuthContainer } from 'core/auth/hooks';
import { useGlobalStatus } from 'core/status/hooks';

interface VersionResponse {
apiVersion: string;
Expand All @@ -11,10 +10,9 @@ interface VersionResponse {
}

export const VersionContainer = createContainer(() => {
const [loggedIn] = AuthContainer.useContainer();
const [loggedIn] = useContainer(AuthContainer);
const [version, setVersion] = useState<VersionResponse>();
const [{ loading, error }, getVersion] = useFlexgetAPI<VersionResponse>('/server/version');
useGlobalStatus(loading, error);
const [{ loading }, getVersion] = useFlexgetAPI<VersionResponse>('/server/version');

useEffect(() => {
const fn = async () => {
Expand Down

0 comments on commit 85b4a3e

Please sign in to comment.