{isProjectOwner
diff --git a/services/web/frontend/js/features/pdf-preview/util/pdf-js-versions.js b/services/web/frontend/js/features/pdf-preview/util/pdf-js-versions.js
index 9a30018b0f..d9e5a13391 100644
--- a/services/web/frontend/js/features/pdf-preview/util/pdf-js-versions.js
+++ b/services/web/frontend/js/features/pdf-preview/util/pdf-js-versions.js
@@ -65,7 +65,7 @@ async function importPDFJS213() {
}
async function importPDFJS() {
- const variant = getMeta('ol-pdfjsVariant', 'default')
+ const variant = getMeta('ol-pdfjsVariant') || 'default'
// NOTE: split test variants must have at least 3 characters
switch (variant) {
diff --git a/services/web/frontend/js/features/plans/utils/group-plan-pricing.js b/services/web/frontend/js/features/plans/utils/group-plan-pricing.js
index d418cf5282..83b8351886 100644
--- a/services/web/frontend/js/features/plans/utils/group-plan-pricing.js
+++ b/services/web/frontend/js/features/plans/utils/group-plan-pricing.js
@@ -20,7 +20,7 @@ export function createLocalizedGroupPlanPrice({
licenseSize,
currency,
usage,
- locale = window.i18n.currentLangCode || 'en',
+ locale = getMeta('ol-i18n').currentLangCode || 'en',
formatCurrency,
}) {
const groupPlans = getMeta('ol-groupPlans')
diff --git a/services/web/frontend/js/features/project-list/components/add-affiliation.tsx b/services/web/frontend/js/features/project-list/components/add-affiliation.tsx
index 29c50da9e6..151ecf9548 100644
--- a/services/web/frontend/js/features/project-list/components/add-affiliation.tsx
+++ b/services/web/frontend/js/features/project-list/components/add-affiliation.tsx
@@ -2,14 +2,12 @@ import { useTranslation } from 'react-i18next'
import { Button } from 'react-bootstrap'
import { useProjectListContext } from '../context/project-list-context'
import getMeta from '../../../utils/meta'
-import { Affiliation } from '../../../../../types/affiliation'
-import { ExposedSettings } from '../../../../../types/exposed-settings'
import classNames from 'classnames'
export function useAddAffiliation() {
const { totalProjectsCount } = useProjectListContext()
- const { isOverleaf } = getMeta('ol-ExposedSettings') as ExposedSettings
- const userAffiliations = getMeta('ol-userAffiliations', []) as Affiliation[]
+ const { isOverleaf } = getMeta('ol-ExposedSettings')
+ const userAffiliations = getMeta('ol-userAffiliations') || []
return {
show: isOverleaf && totalProjectsCount > 0 && !userAffiliations.length,
diff --git a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx
index b9cf6f53e9..ffc20f6f82 100644
--- a/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx
+++ b/services/web/frontend/js/features/project-list/components/current-plan-widget/current-plan-widget.tsx
@@ -3,12 +3,9 @@ import IndividualPlan from './individual-plan'
import GroupPlan from './group-plan'
import CommonsPlan from './commons-plan'
import getMeta from '../../../../utils/meta'
-import { Subscription } from '../../../../../../types/project/dashboard/subscription'
function CurrentPlanWidget() {
- const usersBestSubscription: Subscription | undefined = getMeta(
- 'ol-usersBestSubscription'
- )
+ const usersBestSubscription = getMeta('ol-usersBestSubscription')
if (!usersBestSubscription) {
return null
diff --git a/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx
index 6774849216..a69155acbf 100644
--- a/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx
+++ b/services/web/frontend/js/features/project-list/components/modals/projects-action-modal.tsx
@@ -103,10 +103,7 @@ type ErrorNotificationProps = {
}
function ErrorNotification({ error }: ErrorNotificationProps) {
- const newNotificationStyle = getMeta(
- 'ol-newNotificationStyle',
- false
- ) as boolean
+ const newNotificationStyle = getMeta('ol-newNotificationStyle')
if (newNotificationStyle) {
return (
diff --git a/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx b/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx
index d76f4e4af6..e325fa6487 100644
--- a/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx
+++ b/services/web/frontend/js/features/project-list/components/modals/rename-project-modal.tsx
@@ -36,10 +36,7 @@ function RenameProjectModal({
const { error, isError, isLoading, runAsync } = useAsync()
const { toggleSelectedProject, updateProjectViewData } =
useProjectListContext()
- const newNotificationStyle = getMeta(
- 'ol-newNotificationStyle',
- false
- ) as boolean
+ const newNotificationStyle = getMeta('ol-newNotificationStyle')
useEffect(() => {
if (showModal) {
diff --git a/services/web/frontend/js/features/project-list/components/new-project-button.tsx b/services/web/frontend/js/features/project-list/components/new-project-button.tsx
index fba4f746d6..ba4b39615d 100644
--- a/services/web/frontend/js/features/project-list/components/new-project-button.tsx
+++ b/services/web/frontend/js/features/project-list/components/new-project-button.tsx
@@ -1,8 +1,6 @@
import { type JSXElementConstructor, useCallback, useState } from 'react'
import { Dropdown, MenuItem } from 'react-bootstrap'
import { useTranslation } from 'react-i18next'
-import { ExposedSettings } from '../../../../../types/exposed-settings'
-import type { PortalTemplate } from '../../../../../types/portal-template'
import ControlledDropdown from '../../../shared/components/controlled-dropdown'
import getMeta from '../../../utils/meta'
import NewProjectButtonModal, {
@@ -46,10 +44,10 @@ function NewProjectButton({
showAddAffiliationWidget,
}: NewProjectButtonProps) {
const { t } = useTranslation()
- const { templateLinks } = getMeta('ol-ExposedSettings') as ExposedSettings
+ const { templateLinks } = getMeta('ol-ExposedSettings')
const [modal, setModal] =
useState>(null)
- const portalTemplates = getMeta('ol-portalTemplates') as PortalTemplate[]
+ const portalTemplates = getMeta('ol-portalTemplates') || []
const { show: enableAddAffiliationWidget } = useAddAffiliation()
const sendTrackingEvent = useCallback(
@@ -202,7 +200,7 @@ function NewProjectButton({
}
/>
)}
- {portalTemplates?.length > 0 ? (
+ {portalTemplates.length > 0 ? (
<>