Skip to content

Commit

Permalink
FIX: genesis config modal
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxTheGeeek committed Sep 4, 2024
1 parent 669a535 commit 3eba994
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
:class="getInputType(flattenedGenesis[key]) === 'checkbox' ? 'w-5 h-5' : 'w-full h-9'"
:type="getInputType(flattenedGenesis[key])"
@input="updateStore"
@change="setupStore.genesisChanged = true"
/>
</div>
</template>
Expand All @@ -29,11 +28,8 @@ import { useGenesis } from "@/store/genesis";
import { onMounted, ref, watch } from "vue";
const genesisStore = useGenesis();
const flattenedGenesis = ref({});
onMounted(() => {
initializeFlattenedGenesis();
});
const flattenedGenesis = ref({});
watch(
() => genesisStore.genesis,
Expand Down Expand Up @@ -77,12 +73,6 @@ const getInputType = (value) => {
return "text";
};
//Update genesis store in pina
const updateStore = () => {
const updatedGenesis = unflattenObject(flattenedGenesis.value);
genesisStore.updateGenesisExceptAlloc(updatedGenesis);
};
const unflattenObject = (obj) => {
const result = {};
for (const key in obj) {
Expand All @@ -95,6 +85,17 @@ const unflattenObject = (obj) => {
return result;
};
//Update genesis store in pina
const updateStore = () => {
const updatedGenesis = unflattenObject(flattenedGenesis.value);
genesisStore.updateGenesisExceptAlloc(updatedGenesis);
};
//Lifecycle hooks
onMounted(() => {
initializeFlattenedGenesis();
});
</script>

<style scoped>
Expand Down

0 comments on commit 3eba994

Please sign in to comment.