diff --git a/src/components/Ui/UiInput.vue b/src/components/Ui/UiInput.vue index cdd99e7bd..538f3ffc7 100644 --- a/src/components/Ui/UiInput.vue +++ b/src/components/Ui/UiInput.vue @@ -13,8 +13,8 @@ const props = defineProps<{ const emit = defineEmits(['update:modelValue', 'blur']); -function handleInput(e) { - const input = e.target.value; +function handleInput(e: Event) { + const input = (e.target as HTMLInputElement).value; if (props.number) { return emit('update:modelValue', !input ? undefined : parseFloat(input)); } diff --git a/src/components/Ui/UiSelect.vue b/src/components/Ui/UiSelect.vue index 3aa407b44..a8bec39e1 100644 --- a/src/components/Ui/UiSelect.vue +++ b/src/components/Ui/UiSelect.vue @@ -21,7 +21,7 @@ function handleChange(event) { :disabled="disabled" :value="modelValue" :class="{ disabled }" - class="input h-full w-full flex-auto" + class="input h-full w-full flex-auto !bg-skin-bg" @change="handleChange($event)" > diff --git a/src/composables/useFormSpaceProposal.ts b/src/composables/useFormSpaceProposal.ts index 997682561..a4b7732bd 100644 --- a/src/composables/useFormSpaceProposal.ts +++ b/src/composables/useFormSpaceProposal.ts @@ -2,6 +2,7 @@ import { useStorage } from '@vueuse/core'; import { clone } from '@snapshot-labs/snapshot.js/src/utils'; import schemas from '@snapshot-labs/snapshot.js/src/schemas'; import { validateForm } from '@/helpers/validation'; +import { OsnapPluginData } from '@/plugins/oSnap/types'; interface ProposalForm { name: string; @@ -15,6 +16,7 @@ interface ProposalForm { metadata: { plugins: { safeSnap?: { valid: boolean }; + oSnap?: OsnapPluginData; }; }; } diff --git a/src/composables/useProfiles.ts b/src/composables/useProfiles.ts index 0101b71ce..dc698269a 100644 --- a/src/composables/useProfiles.ts +++ b/src/composables/useProfiles.ts @@ -56,7 +56,7 @@ export function useProfiles() { Object.keys(profilesRes[0] ?? {}).forEach(address => { profilesRes[0][address] = { ...{ ens: profilesRes[0][address] }, - ...profilesRes[1]?.find(p => p.id === address) + ...profilesRes[1]?.find(p => p.id.toLowerCase() === address) }; }); } diff --git a/src/plugins/oSnap/Create.vue b/src/plugins/oSnap/Create.vue index 491b3eb62..34e813ce7 100644 --- a/src/plugins/oSnap/Create.vue +++ b/src/plugins/oSnap/Create.vue @@ -14,10 +14,12 @@ import { Transaction } from './types'; import { + allTransactionsValid, getGnosisSafeBalances, getGnosisSafeCollectibles, getIsOsnapEnabled, - getModuleAddressForTreasury + getModuleAddressForTreasury, + validateOsnapTransaction } from './utils'; import OsnapMarketingWidget from './components/OsnapMarketingWidget.vue'; @@ -46,12 +48,14 @@ const collectables = ref([]); function addTransaction(transaction: Transaction) { if (newPluginData.value.safe === null) return; newPluginData.value.safe.transactions.push(transaction); + newPluginData.value.safe.isValid = allTransactionsValid( + newPluginData.value.safe.transactions + ); update(newPluginData.value); } function removeTransaction(transactionIndex: number) { if (!newPluginData.value.safe) return; - newPluginData.value.safe.transactions.splice(transactionIndex, 1); update(newPluginData.value); } @@ -59,6 +63,9 @@ function removeTransaction(transactionIndex: number) { function updateTransaction(transaction: Transaction, transactionIndex: number) { if (!newPluginData.value.safe) return; newPluginData.value.safe.transactions[transactionIndex] = transaction; + newPluginData.value.safe.isValid = allTransactionsValid( + newPluginData.value.safe.transactions + ); update(newPluginData.value); } @@ -76,7 +83,6 @@ async function fetchBalances(network: Network, safeAddress: string) { if (!safeAddress) { return []; } - try { const balances = await getGnosisSafeBalances(network, safeAddress); @@ -233,7 +239,8 @@ onMounted(async () => {

Warning: Multiple oSnap enabled plugins detected

- For best experience using oSnap, please remove the SafeSnap plugin from your space. + For best experience using oSnap, please remove the SafeSnap plugin from + your space.

diff --git a/src/plugins/oSnap/components/Input/Amount.vue b/src/plugins/oSnap/components/Input/Amount.vue index 0a841a5c1..732544db3 100644 --- a/src/plugins/oSnap/components/Input/Amount.vue +++ b/src/plugins/oSnap/components/Input/Amount.vue @@ -1,11 +1,14 @@