Skip to content

Commit

Permalink
tsc error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
doggan committed Sep 7, 2023
1 parent bb092d9 commit e8a8b9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions packages/desktop-client/src/components/LoggedInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function LoggedInUser({

async function onChangePassword() {
await closeBudget();
window.__navigate('/change-password');
window.__navigate?.('/change-password');
}

async function onMenuSelect(type) {
Expand All @@ -45,14 +45,14 @@ export default function LoggedInUser({
break;
case 'sign-in':
await closeBudget();
window.__navigate('/login');
window.__navigate?.('/login');
break;
case 'sign-out':
signOut();
break;
case 'config-server':
await closeBudget();
window.__navigate('/config-server');
window.__navigate?.('/config-server');
break;
default:
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function ConfigServer() {
let currentUrl = useServerURL();
let setServerUrl = useSetServerURL();
useEffect(() => {
setUrl(currentUrl);
setUrl(currentUrl || '');
}, [currentUrl]);
let [loading, setLoading] = useState(false);
let [error, setError] = useState<string | null>(null);
Expand Down Expand Up @@ -77,15 +77,15 @@ export default function ConfigServer() {
}

async function onSkip() {
await setServerUrl(null);
await setServerUrl('');
await loggedIn();
navigate('/');
}

async function onCreateTestFile() {
await setServerUrl(null);
await setServerUrl('');
await createBudget({ testMode: true });
window.__navigate('/');
window.__navigate?.('/');
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Import({ modalProps }: ImportProps) {
const [importing, setImporting] = useState(false);

async function onImport() {
const res = await window.Actual.openFileDialog({
const res = await window.Actual?.openFileDialog({
properties: ['openFile'],
filters: [{ name: 'actual', extensions: ['zip', 'blob'] }],
});
Expand Down
2 changes: 1 addition & 1 deletion packages/loot-core/src/client/actions/budgets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export function importBudget(
dispatch(closeModal());

await dispatch(loadPrefs());
window.__navigate('/budget');
window.__navigate?.('/budget');
};
}

Expand Down

0 comments on commit e8a8b9a

Please sign in to comment.