diff --git a/frontend/src/framework/internal/components/Settings/private-components/syncSettings.tsx b/frontend/src/framework/internal/components/Settings/private-components/syncSettings.tsx index 2f7c7d272..908b875c6 100644 --- a/frontend/src/framework/internal/components/Settings/private-components/syncSettings.tsx +++ b/frontend/src/framework/internal/components/Settings/private-components/syncSettings.tsx @@ -69,54 +69,59 @@ export const SyncSettings: React.FC = (props) => { return true; } + function makeContent() { + const syncableSettingKeys = activeModuleInstance?.getModule().getSyncableSettingKeys() ?? []; + + if (activeModuleId === "" || activeModuleInstance === undefined) { + return
No module selected
; + } + + if (syncableSettingKeys.length === 0) { + return
No syncable settings
; + } + + return ( + + + + + + + + + + {syncableSettingKeys.map((setting) => { + const globallySynced = isGlobalSyncSetting(setting); + return ( + + + + + + ); + })} + +
+ + + +
+ handleGlobalSyncSettingChange(setting, e.target.checked)} + /> + + handleSyncSettingChange(setting, e.target.checked)} + /> + {SyncSettingsMeta[setting].name}
+ ); + } + return ( } visible={drawerContent === DrawerContent.SyncSettings}> - {activeModuleId === "" || activeModuleInstance === undefined ? ( -
No module selected
- ) : ( - - - - - - - - - - {activeModuleInstance - .getModule() - .getSyncableSettingKeys() - .map((setting) => { - const globallySynced = isGlobalSyncSetting(setting); - return ( - - - - - - ); - })} - -
- - - -
- - handleGlobalSyncSettingChange(setting, e.target.checked) - } - /> - - handleSyncSettingChange(setting, e.target.checked)} - /> - {SyncSettingsMeta[setting].name}
- )} + {makeContent()}
); };