At implementing login and getUser

This commit is contained in:
49lf
2024-07-24 21:37:29 -04:00
parent 0b454939b3
commit 118ac33ebe
16 changed files with 264 additions and 176 deletions

View File

@ -15,14 +15,16 @@ class FileSystemManager {
}
async join(dir: string, path: string): Promise<string> {
return window.electron.ipcRenderer.invoke('join', [dir, path]);
return window.electron.ipcRenderer.invoke('join', [dir, path])
}
async readFile(path: string): Promise<Uint8Array | void> {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error('This function can only be called from the desktop application')
new Error(
'This function can only be called from the desktop application'
)
)
}
@ -39,7 +41,9 @@ class FileSystemManager {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error('This function can only be called from the desktop application')
new Error(
'This function can only be called from the desktop application'
)
)
}
@ -56,7 +60,9 @@ class FileSystemManager {
// Using local file system only works from desktop.
if (!isDesktop()) {
return Promise.reject(
new Error('This function can only be called from the desktop application')
new Error(
'This function can only be called from the desktop application'
)
)
}
@ -65,7 +71,8 @@ class FileSystemManager {
return Promise.reject(new Error(`Error joining dir: ${error}`))
})
.then((filepath) => {
return window.electron.ipcRenderer.invoke('readdir', [filepath])
return window.electron.ipcRenderer
.invoke('readdir', [filepath])
.catch((error) => {
return Promise.reject(new Error(`Error reading dir: ${error}`))
})