Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-mereuta committed Dec 2, 2024
1 parent a84343c commit 350a191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/StudioProjectLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
UserInterfaceWithOutputSettings,
} from './types/types';
import { getDownloadLink } from './utils/documentExportHelper';
import { SESSION_USER_INTEFACE_ID_KEY } from './utils/constants';

export class StudioProjectLoader {
private projectDownloadUrl?: string;
Expand Down Expand Up @@ -223,10 +224,11 @@ export class StudioProjectLoader {
});
return mappedOutputSettings;
};

if (userInterfaceId) {
// userInterfaceID from projectConfig or session-stored userInterfaceId
const userInterface = userInterfaceId || sessionStorage.getItem(SESSION_USER_INTEFACE_ID_KEY);
if (userInterface) {
const userInterfaceData: UserInterface = await axios
.get(`${this.graFxStudioEnvironmentApiBaseUrl}/user-interfaces/${userInterfaceId}`, {
.get(`${this.graFxStudioEnvironmentApiBaseUrl}/user-interfaces/${userInterface}`, {
headers: { Authorization: `Bearer ${this.authToken}` },
})
.then((res) => res.data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const useUserInterfaceSelector = () => {
const validUserInterfaceForTemplate = userInterfaces.find(
(item) => item.id === sessionStorage.getItem(SESSION_USER_INTEFACE_ID_KEY),
)?.id;

const selectedUserInterface =
validUserInterfaceForTemplate || selectedUserInterfaceId || userInterfaces.find((item) => item.default)?.id;

Expand Down

0 comments on commit 350a191

Please sign in to comment.