Skip to content

Commit d44077f

Browse files
committed
update state names
1 parent 4120471 commit d44077f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/lib/AccessState.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ export function useAuth(): boolean {
77
return !features.login.open || isUserLoggedIn();
88
}
99

10-
export function openUsersOnly(): boolean {
11-
return (
12-
(browser && page.url.pathname.includes('/discover')) ||
13-
(!isUserLoggedIn() && features.explorer.open)
14-
);
10+
export function isOpenAccess(): boolean {
11+
return (browser && page.url.pathname.includes('/discover')) || !isUserLoggedIn();
1512
}
1613

17-
export function authorizedUsersOnly(): boolean {
14+
export function isAuthorizedAccess(): boolean {
1815
return isUserLoggedIn() && !features.explorer.open;
1916
}

src/lib/components/explorer/cell/Actions.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import ExportStore from '$lib/stores/Export';
66
import { panelOpen } from '$lib/stores/SidePanel';
77
import { features } from '$lib/configuration';
8-
import { authorizedUsersOnly, openUsersOnly } from '$lib/AccessState';
8+
import { isAuthorizedAccess, isOpenAccess } from '$lib/AccessState';
99
import { genericUUID } from '$lib/utilities/UUID';
1010
1111
let { exports, addExport, removeExport } = ExportStore;
@@ -45,7 +45,7 @@
4545
let isExported = $derived(
4646
$exports.map((exp) => exp.conceptPath).includes(exportItem.conceptPath),
4747
);
48-
let shouldDisableFilter = $derived(!authorizedUsersOnly() && !data.row.allowFiltering);
48+
let shouldDisableFilter = $derived(!isAuthorizedAccess() && !data.row.allowFiltering);
4949
</script>
5050

5151
<button type="button" title="Information" class="btn-icon-color" onclick={insertInfoContent}>
@@ -75,7 +75,7 @@
7575
<span class="sr-only">View Data Hierarchy</span>
7676
</button>
7777
{/if}
78-
{#if features.explorer.exportsEnableExport && !openUsersOnly()}
78+
{#if features.explorer.exportsEnableExport && !isOpenAccess()}
7979
<button
8080
type="button"
8181
title={isExported ? 'Remove from Analysis' : 'Add for Analysis'}

0 commit comments

Comments
 (0)