diff --git a/apps/remix-ide-e2e/src/tests/publishContract.test.ts b/apps/remix-ide-e2e/src/tests/publishContract.test.ts index 63b0dfeb61..5161584789 100644 --- a/apps/remix-ide-e2e/src/tests/publishContract.test.ts +++ b/apps/remix-ide-e2e/src/tests/publishContract.test.ts @@ -66,7 +66,9 @@ module.exports = { .waitForElementVisible('*[data-id="Deploy - transact (not payable)"]') .click('*[data-id="Deploy - transact (not payable)"]') .pause(5000) - .waitForElementVisible('[data-id="udappModalDialogModalBody-react"]') + .waitForElementVisible('[data-id="publishToStorageModalDialogModalBody-react"]', 60000) + .click('[data-id="publishToStorage-modal-footer-ok-react"]') + .pause(8000) .getText('[data-id="udappModalDialogModalBody-react"]', (result) => { const value = typeof result.value === 'string' ? result.value : null diff --git a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx index e8f68524c4..4d9e25f404 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publish-to-storage.tsx @@ -6,6 +6,7 @@ import { publishToSwarm } from './publishOnSwarm' export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { const { api, storage, contract, resetStorage } = props + const [modalShown, setModalShown] = useState(false) const [state, setState] = useState({ modal: { title: '', @@ -38,7 +39,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { modal('Swarm Publish Failed', publishMessageFailed(storage, parseError)) } } else { - if (!api.config.get('settings/ipfs-url')) { + if (!api.config.get('settings/ipfs-url') && !modalShown) { modal('IPFS Settings',
You have not set your own custom IPFS settings.



We won’t be providing a public endpoint anymore for publishing your contracts to IPFS.

Instead of that, 4 options are now available:

@@ -82,6 +83,7 @@ export const PublishToStorage = (props: RemixUiPublishToStorageProps) => { } catch (err) { modal('IPFS Publish Failed', publishMessageFailed(storage, err)) } + setModalShown(true) } const publishMessage = (uploaded) => ( diff --git a/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx b/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx index 44a45a6329..dbea8a4766 100644 --- a/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx +++ b/libs/remix-ui/publish-to-storage/src/lib/publishToIPFS.tsx @@ -121,7 +121,7 @@ const ipfsVerifiedPublish = async (content, expectedHash, api) => { if (expectedHash && hash !== expectedHash) { return { message: 'hash mismatch between solidity bytecode and uploaded content.', url: 'dweb:/ipfs/' + hash, hash } } else { - api.writeFile('ipfs/' + results, content) + api.writeFile('ipfs/' + hash, content) return { message: 'ok', url: 'dweb:/ipfs/' + hash, hash } } } catch (error) {