Skip to content

Commit

Permalink
Remove undefined error from subscribe-needs-bootstrap type
Browse files Browse the repository at this point in the history
  • Loading branch information
twk3 committed Dec 31, 2023
1 parent 0b5c915 commit 463d31f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
13 changes: 5 additions & 8 deletions packages/loot-core/src/server/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1670,14 +1670,11 @@ handlers['set-server-url'] = async function ({ url, validate = true }) {

if (validate) {
// Validate the server is running
const { error } = await runHandler(
handlers['subscribe-needs-bootstrap'],
{
url,
},
);
if (error) {
return { error };
const result = await runHandler(handlers['subscribe-needs-bootstrap'], {
url,
});
if ('error' in result) {
return { error: result.error };
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions packages/loot-core/src/types/server-handlers.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ export interface ServerHandlers {
'subscribe-needs-bootstrap': (
args: { url } = {},
) => Promise<
| { error: string }
| { bootstrapped: unknown; hasServer: boolean; error?: undefined }
{ error: string } | { bootstrapped: unknown; hasServer: boolean }
>;

'subscribe-bootstrap': (arg: { password }) => Promise<{ error?: string }>;
Expand Down

0 comments on commit 463d31f

Please sign in to comment.