Correcting type errors

This commit is contained in:
49lf
2024-07-31 16:54:32 -04:00
parent 638217311b
commit aa4e9cbc64
15 changed files with 91 additions and 47 deletions

View File

@ -82,9 +82,7 @@ export async function ensureProjectDirectoryExists(
await window.electron.stat(projectDir)
} catch (e) {
if (e === 'ENOENT') {
await window.electron.mkdir(projectDir, { recursive: true }, (e) => {
console.log(e)
})
await window.electron.mkdir(projectDir, { recursive: true })
}
}
@ -389,7 +387,7 @@ export const getInitialDefaultDir = async () => {
export const readProjectSettingsFile = async (
projectPath: string
): ProjectConfiguration => {
): Promise<ProjectConfiguration> => {
let settingsPath = await getProjectSettingsFilePath(projectPath)
// Check if this file exists.
@ -398,7 +396,7 @@ export const readProjectSettingsFile = async (
} catch (e) {
if (e === 'ENOENT') {
// Return the default configuration.
return {}
return { settings: {} }
}
}
@ -446,7 +444,7 @@ export const setState = async (
export const getUser = async (
token: string,
hostname: string
): Models['User_type'] => {
): Promise<Models['User_type']> => {
// Use the host passed in if it's set.
// Otherwise, use the default host.
const host = !hostname ? DEFAULT_HOST : hostname