Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@json.ms/www",
"private": true,
"type": "module",
"version": "1.2.19",
"version": "1.2.20",
"scripts": {
"dev": "vite --host",
"build": "run-p type-check \"build-only {@}\" --",
Expand Down
12 changes: 6 additions & 6 deletions src/components/StructureEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {useGlobalStore} from '@/stores/global';
import {useTypings} from "@/composables/typings";
import {useModelStore} from "@/stores/model";
import {useSyncing} from "@/composables/syncing";
import {useUserData} from "@/composables/user-data";
// import yaml from 'js-yaml';

const emit = defineEmits(['save', 'create', 'change', 'focus', 'blur']);
Expand All @@ -23,8 +24,8 @@ const { columns = false, userData } = defineProps<{
}>();
const { canSaveStructure, yamlException, structureStates } = useStructure();
const modelStore = useModelStore();
const { getTypescriptTypings, getTypescriptDefaultObj, lastStateTimestamp } = useTypings();
const { isFolderSynced, askToSyncFolder, unSyncFolder } = useSyncing();
const { getTypescriptTypings, getTypescriptDefaultObj } = useTypings();
const { isFolderSynced, askToSyncFolder, unSyncFolder, lastStateTimestamp } = useSyncing();
const showParsingDelay = ref(false);
const progressBarValue = ref(0);
const progressBarCompleted = ref(false);
Expand Down Expand Up @@ -108,11 +109,10 @@ const value = computed({
return structure.value.content;
},
set(value: string) {
modelStore.setTemporaryContent(value);
if (globalStore.userSettings.data.editorLiveUpdate) {
emit('change', value);
} else {
modelStore.setTemporaryContent(value);

clearInterval(parseInterval);
clearInterval(showParseInterval);
clearInterval(parseValueInterval);
Expand Down Expand Up @@ -582,7 +582,7 @@ watch(() => globalStore.userSettings.data, () => {
size="small"
/>
<v-tooltip
v-if="isFolderSynced(modelStore.structure)"
v-if="modelStore.structure.server_url || isFolderSynced(modelStore.structure)"
text="Save (CTRL+S)"
location="bottom"
>
Expand All @@ -591,7 +591,7 @@ watch(() => globalStore.userSettings.data, () => {
v-if="structure"
v-bind="props"
:loading="structureStates.saving"
:disabled="!canSaveStructure || structureStates.saving || structureStates.saved"
:disabled="!canSaveStructure || (!modelStore.structure.server_url && !isFolderSynced(modelStore.structure)) || structureStates.saving || structureStates.saved"
:prepend-icon="!structureStates.saved ? 'mdi-content-save' : 'mdi-check'"
variant="outlined"
color="primary"
Expand Down
3 changes: 3 additions & 0 deletions src/components/Toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -365,18 +365,21 @@ watch(() => currentRoute.params.locale, () => {
<v-divider class="my-1" />
<v-list-item
:disabled="userDataLoading || !canFetchUserData"
:subtitle="!canFetchUserData ? 'Requires an endpoint' : ''"
prepend-icon="mdi-monitor-arrow-down"
title="Fetch data"
@click="onFetchUserData"
/>
<v-list-item
:disabled="downloading || !canInteractWithServer"
:subtitle="!canInteractWithServer ? 'Requires an endpoint' : ''"
title="Download data"
prepend-icon="mdi-tray-arrow-down"
@click="downloadUserData"
/>
<v-list-item
:disabled="migrating || !canInteractWithServer"
:subtitle="!canInteractWithServer ? 'Requires an endpoint' : ''"
title="Migrate data"
prepend-icon="mdi-folder-arrow-left-right-outline"
@click="onMigrateData"
Expand Down