Skip to content

Commit

Permalink
fix: field not visible when hosting, init default value is taken from…
Browse files Browse the repository at this point in the history
… env file, now 1800 seconds
  • Loading branch information
kstroobants committed Dec 10, 2024
1 parent 1483224 commit 5aec90b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions frontend/src/hooks/useConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ export const useConfig = () => {
const isHostedEnvironment = import.meta.env.VITE_IS_HOSTED === 'true';
const canUpdateValidators = !isHostedEnvironment;
const canUpdateProviders = !isHostedEnvironment;
const canUpdateFinalityWindow = !isHostedEnvironment;

return {
canUpdateValidators,
canUpdateProviders,
canUpdateFinalityWindow,
};
};
5 changes: 3 additions & 2 deletions frontend/src/views/Simulator/RunDebugView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ConstructorParameters from '@/components/Simulator/ConstructorParameters.
import ContractReadMethods from '@/components/Simulator/ContractReadMethods.vue';
import ContractWriteMethods from '@/components/Simulator/ContractWriteMethods.vue';
import TransactionsList from '@/components/Simulator/TransactionsList.vue';
import { useContractQueries } from '@/hooks';
import { useContractQueries, useConfig } from '@/hooks';
import MainTitle from '@/components/Simulator/MainTitle.vue';
import { ref, watch, computed } from 'vue';
import { useContractsStore, useNodeStore } from '@/stores';
Expand All @@ -18,6 +18,7 @@ const leaderOnly = ref(false);
const isDeploymentOpen = ref(!isDeployed.value);
const finalityWindow = ref(Number(import.meta.env.VITE_FINALITY_WINDOW));
const { canUpdateFinalityWindow } = useConfig();
// Hide constructors by default when contract is already deployed
const setConstructorVisibility = () => {
Expand Down Expand Up @@ -54,7 +55,7 @@ const isFinalityWindowValid = computed(() => {
class="p-2"
/>

<div class="p-2">
<div v-if="canUpdateFinalityWindow" class="p-2">
<div class="flex flex-wrap items-center gap-2">
<label for="finalityWindow" class="text-xs"
>Finality Window (seconds)</label
Expand Down

0 comments on commit 5aec90b

Please sign in to comment.