Skip to content

Commit

Permalink
wip to mapping editting
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkorotkov committed Aug 21, 2021
1 parent 92e808e commit d42e402
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/workspace/index/tabs/Mapping.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script>
import JSONEditor from 'jsoneditor'
import { onMount, onDestroy, afterUpdate, getContext } from 'svelte'
import { onMount, onDestroy } from 'svelte'
import { useStoreon } from '@storeon/svelte'
import get from 'lodash/get'
Expand Down Expand Up @@ -45,18 +45,6 @@
if (!$index.info[$index.selected]) dispatch('elasticsearch/index/fetch')
})
afterUpdate(() => {
const mappings = get(
$index.info,
[$index.selected, $index.selected, 'mappings'],
false
)
try {
if (mappings !== mpEditor.get()) mpEditor.update(mappings)
} catch (error) {}
})
onDestroy(() => {
if (mpEditor) {
mpEditor.destroy()
Expand Down Expand Up @@ -132,7 +120,8 @@
class="ui green basic button"
on:click={e => onUpdateMappingClick($index.selected)}
class:loading={isLoading}
disabled={isLoading || !canUpdate}>
disabled={isLoading || !canUpdate}
>
Update
</button>
</div>
Expand Down

0 comments on commit d42e402

Please sign in to comment.