Skip to content

Commit

Permalink
Fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 4, 2023
1 parent f71c942 commit 6bbfbf3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions data-browser/src/views/ErrorPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ function ErrorPage({ resource }: ResourcePageProps): JSX.Element {

React.useEffect(() => {
// Try again when agent changes
store.fetchResource(subject);
store.fetchResourceFromServer(subject);
}, [agent]);

if (isUnauthorized(resource.error)) {
// This might be a bit too aggressive, but it fixes 'Unauthorized' messages after signing in to a new drive.
store.fetchResource(subject);
store.fetchResourceFromServer(subject);

return (
<ContainerWide>
Expand Down
3 changes: 1 addition & 2 deletions lib/src/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ const setCookieExpires = (
};

/** Sets a cookie for the current Agent, signing the Authentication. It expires after some default time. */
export const setCookieAuthentication = (store: Store, agent: Agent) => {
const serverURL = store.getServerUrl();
export const setCookieAuthentication = (serverURL: string, agent: Agent) => {
createAuthentication(serverURL, agent).then(auth => {
setCookieExpires(COOKIE_NAME_AUTH, btoa(JSON.stringify(auth)), serverURL);
});
Expand Down
3 changes: 0 additions & 3 deletions lib/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ import {
ErrorType,
JSONADParser,
parseCommit,
parseJsonADArray,
parseJsonADResource,
removeCookieAuthentication,
Resource,
serializeDeterministically,
setCookieAuthentication,
Expand Down

0 comments on commit 6bbfbf3

Please sign in to comment.