Skip to content
Snippets Groups Projects
Unverified Commit 444daae8 authored by Matiss Janis Aboltins's avatar Matiss Janis Aboltins Committed by GitHub
Browse files

Merge pull request #423 from j-f1/improve-no-server-handling

Improve handling of “no server” state
parents 5877258d d6110731
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ function LoggedInUser({ ...@@ -37,7 +37,7 @@ function LoggedInUser({
async function onChangePassword() { async function onChangePassword() {
await closeBudget(); await closeBudget();
history.push('/change-password'); window.__history.push('/change-password');
} }
function onMenuSelect(type) { function onMenuSelect(type) {
...@@ -54,11 +54,12 @@ function LoggedInUser({ ...@@ -54,11 +54,12 @@ function LoggedInUser({
} }
} }
function onClick() { async function onClick() {
if (serverUrl) { if (serverUrl) {
setMenuOpen(true); setMenuOpen(true);
} else { } else {
history.push('/config-server'); await closeBudget();
window.__history.push('/config-server');
} }
} }
......
...@@ -22,6 +22,7 @@ import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle'; ...@@ -22,6 +22,7 @@ import AlertTriangle from 'loot-design/src/svg/v2/AlertTriangle';
import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1'; import ArrowButtonRight1 from 'loot-design/src/svg/v2/ArrowButtonRight1';
import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu'; import NavigationMenu from 'loot-design/src/svg/v2/NavigationMenu';
import { useServerURL } from '../hooks/useServerURL';
import AccountSyncCheck from './accounts/AccountSyncCheck'; import AccountSyncCheck from './accounts/AccountSyncCheck';
import AnimatedRefresh from './AnimatedRefresh'; import AnimatedRefresh from './AnimatedRefresh';
import { MonthCountSelector } from './budget/MonthCountSelector'; import { MonthCountSelector } from './budget/MonthCountSelector';
...@@ -247,6 +248,7 @@ function Titlebar({ ...@@ -247,6 +248,7 @@ function Titlebar({
sync sync
}) { }) {
let sidebar = useSidebar(); let sidebar = useSidebar();
const serverURL = useServerURL();
return ( return (
<View <View
...@@ -353,11 +355,13 @@ function Titlebar({ ...@@ -353,11 +355,13 @@ function Titlebar({
</Switch> </Switch>
<View style={{ flex: 1 }} /> <View style={{ flex: 1 }} />
<UncategorizedButton /> <UncategorizedButton />
<SyncButton {serverURL ? (
style={{ marginLeft: 10 }} <SyncButton
localPrefs={localPrefs} style={{ marginLeft: 10 }}
onSync={sync} localPrefs={localPrefs}
/> onSync={sync}
/>
) : null}
<LoggedInUser style={{ marginLeft: 10 }} /> <LoggedInUser style={{ marginLeft: 10 }} />
</View> </View>
); );
......
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