2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-24 18:07:38 +00:00

allow mobile check ignore (#10529)

* allow mobile check ignore

* add docs
This commit is contained in:
Lukas
2025-10-09 00:44:40 +02:00
committed by GitHub
parent 7ca72ff262
commit cb0b0bcd0d
4 changed files with 36 additions and 5 deletions

View File

@@ -35,6 +35,7 @@ declare global {
api_host?: string;
sentry_dsn?: string;
environment?: string;
mobile_mode?: 'default' | 'allow-ignore' | 'allow-always';
};
react: typeof React;
React: typeof React;

View File

@@ -40,7 +40,11 @@ export default function MainView() {
}, []);
// Check if mobile
if (!allowMobile && checkMobile()) {
if (
!allowMobile &&
window.INVENTREE_SETTINGS.mobile_mode !== 'allow-always' &&
checkMobile()
) {
return <MobileAppView />;
}

View File

@@ -33,8 +33,12 @@ export default function MobileAppView() {
<Anchor href={docLinks.app}>
<Trans>Read the docs</Trans>
</Anchor>
{IS_DEV && (
<Text onClick={ignore}>
{(IS_DEV ||
window.INVENTREE_SETTINGS.mobile_mode === 'allow-ignore') && (
<Text
onClick={ignore}
style={{ cursor: 'pointer', textDecoration: 'underline' }}
>
<Trans>Ignore and continue to Desktop view</Trans>
</Text>
)}