diff --git a/package.json b/package.json index b45e1d3..76148bc 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@json.ms/www", "private": true, "type": "module", - "version": "1.3.8", + "version": "1.3.9", "scripts": { "dev": "vite --host", "build": "run-p type-check \"build-only {@}\" --", diff --git a/src/components/FileManager.vue b/src/components/FileManager.vue index 91a5962..3c43881 100644 --- a/src/components/FileManager.vue +++ b/src/components/FileManager.vue @@ -45,6 +45,10 @@ const getFilesByType = (type: string): IFile[] => { return acceptedFiles.value.filter((file: IFile) => file.meta.type?.startsWith('video')); } else if (type === 'document') { return acceptedFiles.value.filter((file: IFile) => !file.meta.type?.startsWith('image') && !file.meta.type?.startsWith('video')); + } else if (type === 'local') { + return acceptedFiles.value.filter((file: IFile) => file.origin === 'local'); + } else if (type === 'remote') { + return acceptedFiles.value.filter((file: IFile) => file.origin === 'remote'); } return []; } @@ -123,6 +127,7 @@ const load = () => { if (!['data.json', 'structure.json', 'structure.yml', 'default.ts', 'index.ts', 'typings.ts', 'settings.json'].includes(item.path)) { files.value.push({ path: item.path, + origin: 'local', meta: { type: item.file.type, width: item.width, @@ -136,7 +141,7 @@ const load = () => { }); endpointResponse.forEach((item: IFile) => { - files.value.push(item); + files.value.push(({ ...item, origin: 'remote' })); }); selectedFiles.value = []; @@ -348,6 +353,15 @@ watch(() => globalStore.fileManager.visible, () => { Document ({{ getFilesByType('document').length }}) + @@ -457,7 +471,24 @@ watch(() => globalStore.fileManager.visible, () => { @click="onFileClick(item)" >
- + +
+
+ + + +
globalStore.userSettings.data, () => {
- +
-
- +
- objectsAreDifferent(modelStore.userData, modelStore.originalUserData)); const canSave = computed((): boolean => { + const canSaveWithServer = globalStore.session.loggedIn && canInteractWithServer.value; return !saving.value - && globalStore.session.loggedIn - && (canInteractWithServer.value || canInteractWithSyncedFolder.value) + && (canSaveWithServer || canInteractWithSyncedFolder.value) // && !userDataHasError.value && userDataHasChanged.value && structureIsPristine.value; diff --git a/src/interfaces.ts b/src/interfaces.ts index cd08245..afd4f9a 100644 --- a/src/interfaces.ts +++ b/src/interfaces.ts @@ -61,6 +61,7 @@ export interface IError { export interface IFile { path: string | null, + origin?: 'local' | 'remote', blob?: string | undefined, meta: { type?: string,