Skip to content
Snippets Groups Projects
Unverified Commit 3d5818f0 authored by Michael Clark's avatar Michael Clark Committed by GitHub
Browse files

:electron: Fix electron "Data Dir" picker on Settings page (#3133)

* fix electron file location picker

* add release notes

* update message and style
parent efd294dc
No related branches found
No related tags found
No related merge requests found
...@@ -34,36 +34,40 @@ export function GlobalSettings() { ...@@ -34,36 +34,40 @@ export function GlobalSettings() {
return ( return (
<Setting <Setting
primaryAction={ 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 && ( {documentDirChanged && (
<Information> <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> </Information>
)} )}
</View> </>
} }
> >
<Text> <Text>
<strong>Actual’s files</strong> are stored in a folder on your computer. <strong>Actual’s files</strong> are stored in a folder on your computer.
Currently, that’s: Currently, that’s:
</Text> </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> </Setting>
); );
} }
...@@ -2,8 +2,8 @@ import React, { type ReactNode, useEffect } from 'react'; ...@@ -2,8 +2,8 @@ import React, { type ReactNode, useEffect } from 'react';
import { media } from 'glamor'; import { media } from 'glamor';
import * as Platform from 'loot-core/src/client/platform';
import { listen } from 'loot-core/src/platform/client/fetch'; import { listen } from 'loot-core/src/platform/client/fetch';
import { isElectron } from 'loot-core/src/shared/environment';
import { useActions } from '../../hooks/useActions'; import { useActions } from '../../hooks/useActions';
import { useFeatureFlag } from '../../hooks/useFeatureFlag'; import { useFeatureFlag } from '../../hooks/useFeatureFlag';
...@@ -172,17 +172,13 @@ export function Settings() { ...@@ -172,17 +172,13 @@ export function Settings() {
<Button onPress={closeBudget}>Close Budget</Button> <Button onPress={closeBudget}>Close Budget</Button>
</View> </View>
)} )}
<About /> <About />
{isElectron() && <GlobalSettings />}
{!Platform.isBrowser && <GlobalSettings />}
<ThemeSettings /> <ThemeSettings />
<FormatSettings /> <FormatSettings />
<EncryptionSettings /> <EncryptionSettings />
{useFeatureFlag('reportBudget') && <BudgetTypeSettings />} {useFeatureFlag('reportBudget') && <BudgetTypeSettings />}
<ExportBudget /> <ExportBudget />
<AdvancedToggle> <AdvancedToggle>
<AdvancedAbout /> <AdvancedAbout />
<ResetCache /> <ResetCache />
......
---
category: Bugfix
authors: [MikesGlitch]
---
Fix the Data Dir Location picker not showing on the Settings page when running in Electron.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment