Skip to content

Commit

Permalink
Fix admin store access
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Jun 3, 2024
1 parent c02bb8d commit 5b9ce83
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions admin/src/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import { AutoEndSessionDialog } from "./react-components/auto-end-session-dialog
import registerTelemetry from "hubs/src/telemetry";
import { createMuiTheme, withStyles } from "@material-ui/core/styles";
import { UnauthorizedPage } from "./react-components/unauthorized";
import { store } from "hubs/src/utils/store-instance";
import { getStore } from "hubs/src/utils/store-instance";

const qs = new URLSearchParams(location.hash.split("?")[1]);

window.APP = { store };
window.APP = { store: getStore() };

registerTelemetry("/admin", "Hubs Admin");

Expand Down Expand Up @@ -185,6 +185,7 @@ const mountUI = async (retPhxChannel, customRoutes, layout) => {

let permsTokenRefreshInterval;

const store = APP.store;
if (configs.POSTGREST_SERVER) {
dataProvider = postgrestClient(configs.POSTGREST_SERVER);
authProvider = postgrestAuthenticatior.createAuthProvider(retPhxChannel);
Expand Down Expand Up @@ -234,6 +235,7 @@ const HiddenAppBar = withStyles({
document.addEventListener("DOMContentLoaded", async () => {
const socket = await connectToReticulum();

const store = APP.store;
if (store.state && store.state.credentials && store.state.credentials.token) {
setItaAuthToken(store.state.credentials.token);
try {
Expand Down

0 comments on commit 5b9ce83

Please sign in to comment.