Skip to content

Commit

Permalink
Fix base url default
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Oct 18, 2022
1 parent 80e6c66 commit 1702099
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion data-browser/src/helpers/AppSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ export const AppSettingsContextProvider = (

const [agent, setAgent] = useCurrentAgent();
const [baseURL, setBaseURL] = useServerURL();
const [drive, innerSetDrive] = useLocalStorage('drive', baseURL);
// By default, we want to use the current URL's origin with a trailing slash.
const [drive, innerSetDrive] = useLocalStorage('drive', baseURL + '/');

function setDrive(newDrive: string) {
const url = new URL(newDrive);
Expand Down
2 changes: 1 addition & 1 deletion data-browser/tests/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test.describe('data-browser', async () => {
await page.goto(frontEndUrl);
// Sometimes we run the test server on a different port, but we should
// only change the drive if it is non-default.
if (serverUrl !== 'http://localhost:9883') {
if (serverUrl !== defaultDevServer) {
await changeDrive(serverUrl, page);
}
await expect(page.locator(currentDriveTitle)).toBeVisible();
Expand Down

0 comments on commit 1702099

Please sign in to comment.