From 394d2d7dc67bd1109757720e095b7ae4d21b05b8 Mon Sep 17 00:00:00 2001 From: Mistium <92952823+Mistium@users.noreply.github.com> Date: Fri, 2 Oct 2026 18:46:37 +0100 Subject: [PATCH 1/2] Keep the desktop app offline, with no Rotur The desktop app (window.EditorPreload, or no web origin) now has no Rotur at all. hasRotur() in lib/rotur/availability.js is the one check: - The Rotur client never restores a session or old token there, never hands out a token, and refuses to sign in or ask for permissions, so nothing reaches api.rotur.dev. - The Rotur bridge answers projects with a clear 'not available' error. - The sign-in button and modal, Products, Game Items, Project history and Live Collaboration are hidden. Signed-out community features already hide themselves. The web editor is unchanged. --- src/components/gui/gui.jsx | 7 +- src/components/menu-bar/menu-bar.jsx | 13 ++-- src/components/menu-bar/mw-rotur-account.jsx | 4 ++ src/containers/rotur-extension-host.jsx | 3 + src/lib/rotur/availability.js | 19 ++++++ src/lib/rotur/client.js | 9 ++- test/unit/rotur-desktop-offline.test.js | 67 ++++++++++++++++++++ 7 files changed, 112 insertions(+), 10 deletions(-) create mode 100644 src/lib/rotur/availability.js create mode 100644 test/unit/rotur-desktop-offline.test.js diff --git a/src/components/gui/gui.jsx b/src/components/gui/gui.jsx index cdc9746a8af..81dc5743c39 100644 --- a/src/components/gui/gui.jsx +++ b/src/components/gui/gui.jsx @@ -19,6 +19,7 @@ import NotificationsProvider from '../../lib/notifications-provider.jsx'; import TWSecurityManager from '../../containers/tw-security-manager.jsx'; import TWInvalidProjectModal from '../../containers/tw-invalid-project-modal.jsx'; import RoturSession from '../../containers/rotur-session.jsx'; +import {hasRotur} from '../../lib/rotur/availability.js'; import RoturExtensionHost from '../../containers/rotur-extension-host.jsx'; import MistWarpGameHost from '../../containers/mistwarp-game-host.jsx'; import RoturLoginModal from '../mw-rotur-login-modal/rotur-login-modal.jsx'; @@ -860,8 +861,8 @@ const GUIComponent = props => { {!isPlayerOnly && } {!isPlayerOnly && } {!isPlayerOnly && } - {!isPlayerOnly && } - {!isPlayerOnly && } + {!isPlayerOnly && hasRotur() && } + {!isPlayerOnly && hasRotur() && } {!isPlayerOnly && } {!isPlayerOnly && } {usernameModalVisible && } @@ -879,7 +880,7 @@ const GUIComponent = props => { {gitModalVisible && } {invalidProjectModalVisible && } - {roturLoginModalVisible && ( + {roturLoginModalVisible && hasRotur() && ( )} diff --git a/src/components/menu-bar/menu-bar.jsx b/src/components/menu-bar/menu-bar.jsx index 02ac4640322..5bac8181424 100644 --- a/src/components/menu-bar/menu-bar.jsx +++ b/src/components/menu-bar/menu-bar.jsx @@ -70,6 +70,7 @@ import {getShortcutKey} from '../../lib/shortcuts/registry.js'; import TWDesktopSettings from './tw-desktop-settings.jsx'; import RoturAccount from './mw-rotur-account.jsx'; import MwEditorNav from './mw-editor-nav.jsx'; +import {hasRotur} from '../../lib/rotur/availability.js'; import CollabPresence from './mw-collab-presence.jsx'; import {FEEDBACK_URL} from '../../lib/constants/brand.js'; @@ -1909,7 +1910,7 @@ class MenuBar extends React.Component { )} - + {hasRotur() && - + } - @@ -1963,8 +1964,8 @@ class MenuBar extends React.Component { description="Menu bar item to open pushed project history" id="mw.menuBar.git" /> - - } + {hasRotur() && @@ -1973,7 +1974,7 @@ class MenuBar extends React.Component { description="Menu bar item for live collaboration" id="tw.menuBar.collaboration" /> - + } { if (onLogout) { @@ -69,6 +70,9 @@ const RoturAccount = props => { logout(props.onLogout); }, [props.onCloseMenu, props.onLogout]); + // The desktop app has no Rotur, so nobody signs in. + if (!hasRotur()) return null; + if (!props.username) { return (