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 23850da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion 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 @@ -197,7 +198,9 @@ export class StudioProjectLoader {
const res = await this.onFetchUserInterfaces();

if (res.status === 200) {
return res.data.data.find((value: UserInterface) => value.default);
return res.data.data.find(
(value: UserInterface) => sessionStorage.getItem(SESSION_USER_INTEFACE_ID_KEY) || value.default,
);
}
throw new Error(`Default user interface not found`);
};
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 23850da

Please sign in to comment.