Login, Download and visuals update
This commit is contained in:
		| @@ -10,6 +10,10 @@ type DirectoryData = { | ||||
|   [filename: string]: FileData; | ||||
| }; | ||||
| export type FileStructure = {id: string, mtime: number, size: number, dir: DirectoryData}; | ||||
| type User = { | ||||
|   isOpenLoginModal: boolean, | ||||
|   isLoggedIn : boolean, | ||||
| } | ||||
|  | ||||
| export type DocumentStore = { | ||||
|   root: FileStructure, | ||||
| @@ -20,6 +24,7 @@ export type DocumentStore = { | ||||
|   wsWatch: WebSocket | undefined, | ||||
|   wsUpload: WebSocket | undefined, | ||||
|   selectedDocuments: Document[], | ||||
|   user: User, | ||||
|   error: string, | ||||
| } | ||||
|  | ||||
| @@ -35,6 +40,7 @@ export const useDocumentStore = defineStore({ | ||||
|     wsUpload: undefined, | ||||
|     selectedDocuments: [] as Document[], | ||||
|     error: '' as string, | ||||
|     user: { isLoggedIn: false, isOpenLoginModal: false } as User | ||||
|   }), | ||||
|  | ||||
|   actions: { | ||||
| @@ -140,7 +146,7 @@ export const useDocumentStore = defineStore({ | ||||
|       for (const d of this.document) { | ||||
|         if ("mtime" in d) d.modified = formatUnixDate(d.mtime) | ||||
|       } | ||||
|     } | ||||
|     }, | ||||
|   }, | ||||
|   getters: { | ||||
|     mainDocument(): Document[] { | ||||
| @@ -151,6 +157,9 @@ export const useDocumentStore = defineStore({ | ||||
|     }, | ||||
|     rootMain(): DirectoryData | undefined { | ||||
|       if(this.root) return this.root.dir | ||||
|     }, | ||||
|     isUserLogged(): boolean{ | ||||
|       return this.user.isLoggedIn | ||||
|     } | ||||
|   }, | ||||
| }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user