Skip to content

Commit

Permalink
Fixed safari loading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jun 11, 2021
1 parent 7b514ba commit f9137b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ui/src/app/dashboard/view/Dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { ActionsTab } from './ActionsTab';
import { useIsAdmin } from '../../core/user/UserContext';
import useFetch from 'use-http';
import API_BASE_PATH from '../../App.constant';
import { getMetadataPath } from '../../metadata/hooks/api';
import { useNonAdminSources } from '../../metadata/hooks/api';

export function Dashboard () {

Expand All @@ -30,6 +30,8 @@ export function Dashboard () {
cachePolicy: 'no-cache'
});

const sourceLoader = useNonAdminSources();

async function loadUsers() {
const users = await get('/admin/users')
if (response.ok) {
Expand All @@ -38,7 +40,7 @@ export function Dashboard () {
}

async function loadSources() {
const s = await get(`/${getMetadataPath('source')}/disabledNonAdmin`);
const s = sourceLoader.get();
if (response.ok) {
setSources(s);
}
Expand Down
4 changes: 4 additions & 0 deletions ui/src/app/metadata/hooks/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export function getMetadataPath(type) {
return `/${details[type]}`;
}

export function useNonAdminSources() {
return useFetch(`/${getMetadataPath('source')}/disabledNonAdmin`);
}

export function getMetadataListPath(type) {
return `/${lists[type]}`;
}
Expand Down

0 comments on commit f9137b6

Please sign in to comment.