diff --git a/packages/desktop-client/src/components/settings/Reset.js b/packages/desktop-client/src/components/settings/Reset.js index f17383cb45f11984859ec6def0255bdb3342adea..16307b4160314caa527c4c41b7ba88a09d46fb86 100644 --- a/packages/desktop-client/src/components/settings/Reset.js +++ b/packages/desktop-client/src/components/settings/Reset.js @@ -34,7 +34,7 @@ export function ResetCache() { ); } -export function ResetSync({ resetSync }) { +export function ResetSync({ isEnabled, resetSync }) { let [resetting, setResetting] = useState(false); async function onResetSync() { @@ -46,17 +46,28 @@ export function ResetSync({ resetSync }) { return ( <Setting primaryAction={ - <ButtonWithLoading loading={resetting} onClick={onResetSync}> + <ButtonWithLoading + loading={resetting} + disabled={!isEnabled} + onClick={onResetSync} + > Reset sync </ButtonWithLoading> } > - <Text> - <strong>Reset sync</strong> will remove all local data used to track - changes for syncing, and create a fresh sync ID on the server. This file - on other devices will have to be re-downloaded to use the new sync ID. - Use this if there is a problem with syncing and you want to start fresh. - </Text> + {isEnabled ? ( + <Text> + <strong>Reset sync</strong> will remove all local data used to track + changes for syncing, and create a fresh sync ID on the server. This + file on other devices will have to be re-downloaded to use the new + sync ID. Use this if there is a problem with syncing and you want to + start fresh. + </Text> + ) : ( + <Text> + <strong>Reset sync</strong> is only available when syncing is enabled. + </Text> + )} </Setting> ); } diff --git a/packages/desktop-client/src/components/settings/index.js b/packages/desktop-client/src/components/settings/index.js index c56f0775e4f6ccffd8a4632ff598e4eb0e15ae10..85b9fbf8c34be25098e0e003dc0fde8aeaeda3b6 100644 --- a/packages/desktop-client/src/components/settings/index.js +++ b/packages/desktop-client/src/components/settings/index.js @@ -176,7 +176,7 @@ function Settings({ <AdvancedToggle> <AdvancedAbout prefs={prefs} /> <ResetCache /> - <ResetSync resetSync={resetSync} /> + <ResetSync isEnabled={!!prefs.groupId} resetSync={resetSync} /> <FixSplitsTool /> <ExperimentalFeatures prefs={prefs} savePrefs={savePrefs} /> </AdvancedToggle> diff --git a/upcoming-release-notes/1104.md b/upcoming-release-notes/1104.md new file mode 100644 index 0000000000000000000000000000000000000000..5baf9c273e9e61c216f6afc148ab22bb75b135d4 --- /dev/null +++ b/upcoming-release-notes/1104.md @@ -0,0 +1,6 @@ +--- +category: Enhancements +authors: [j-f1] +--- + +Disable “Reset sync†button when sync is disabled