diff --git a/packages/desktop-client/src/components/settings/Global.tsx b/packages/desktop-client/src/components/settings/Global.tsx index 242d76d40986174e3de50662ff67b1ed07bd049f..86cedba10ecc397442b76fe65496891db0fa7ee8 100644 --- a/packages/desktop-client/src/components/settings/Global.tsx +++ b/packages/desktop-client/src/components/settings/Global.tsx @@ -34,36 +34,40 @@ export function GlobalSettings() { return ( <Setting primaryAction={ - <View style={{ flexDirection: 'row' }}> - <Button onPress={onChooseDocumentDir}>Change location</Button> + <> + <View style={{ flexDirection: 'row', gap: '0.5rem', width: '100%' }}> + <Text + innerRef={dirScrolled} + title={documentDir} + style={{ + backgroundColor: theme.pageBackground, + padding: '7px 10px', + borderRadius: 4, + overflow: 'auto', + whiteSpace: 'nowrap', + width: '100%', + '::-webkit-scrollbar': { display: 'none' }, // Removes the scrollbar + }} + > + {documentDir} + </Text> + <Button onPress={onChooseDocumentDir}>Change location</Button> + </View> + {documentDirChanged && ( <Information> - A restart is required for this change to take effect + <strong>Remember</strong> to copy your budget(s) into the new + folder. <br />A restart is required for this change to take + effect. </Information> )} - </View> + </> } > <Text> <strong>Actual’s files</strong> are stored in a folder on your computer. Currently, that’s: </Text> - <Text - innerRef={dirScrolled} - style={{ - backgroundColor: theme.pageBackground, - padding: '7px 10px', - borderRadius: 4, - overflow: 'auto', - whiteSpace: 'nowrap', - // TODO: When we update electron, we should be able to - // remove this. In previous versions of Chrome, once the - // scrollbar appears it never goes away - '::-webkit-scrollbar': { display: 'none' }, - }} - > - {documentDir} - </Text> </Setting> ); } diff --git a/packages/desktop-client/src/components/settings/index.tsx b/packages/desktop-client/src/components/settings/index.tsx index bed854ed82302e28500762f1a7240baa13a611d0..f9419332eed7731187efa678f0f545af87ba580d 100644 --- a/packages/desktop-client/src/components/settings/index.tsx +++ b/packages/desktop-client/src/components/settings/index.tsx @@ -2,8 +2,8 @@ import React, { type ReactNode, useEffect } from 'react'; import { media } from 'glamor'; -import * as Platform from 'loot-core/src/client/platform'; import { listen } from 'loot-core/src/platform/client/fetch'; +import { isElectron } from 'loot-core/src/shared/environment'; import { useActions } from '../../hooks/useActions'; import { useFeatureFlag } from '../../hooks/useFeatureFlag'; @@ -172,17 +172,13 @@ export function Settings() { <Button onPress={closeBudget}>Close Budget</Button> </View> )} - <About /> - - {!Platform.isBrowser && <GlobalSettings />} - + {isElectron() && <GlobalSettings />} <ThemeSettings /> <FormatSettings /> <EncryptionSettings /> {useFeatureFlag('reportBudget') && <BudgetTypeSettings />} <ExportBudget /> - <AdvancedToggle> <AdvancedAbout /> <ResetCache /> diff --git a/upcoming-release-notes/3133.md b/upcoming-release-notes/3133.md new file mode 100644 index 0000000000000000000000000000000000000000..c1757b5e7a45234f36223fdb7f032d0c936441f3 --- /dev/null +++ b/upcoming-release-notes/3133.md @@ -0,0 +1,6 @@ +--- +category: Bugfix +authors: [MikesGlitch] +--- + +Fix the Data Dir Location picker not showing on the Settings page when running in Electron.