Skip to content

Commit

Permalink
feat(window.ipfs): remove code for blocked config.get
Browse files Browse the repository at this point in the history
window.ipfs is no longer available, so we no longer need this code
see ipfs/ipfs-companion#777
  • Loading branch information
SgtPooki committed Jul 1, 2023
1 parent 58adfdf commit e2495dd
Show file tree
Hide file tree
Showing 20 changed files with 4 additions and 38 deletions.
1 change: 0 additions & 1 deletion public/locales/ar/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "إيقاف"
},
"fetchingSettings": "جارٍ جلب الإعدادات ...",
"configApiNotAvailable": "API تكوين IPFS غير متوفر. الرجاء تعطيل ملحق الويب \"IPFS Companion\" وإعادة المحاولة.",
"ipfsDaemonOffline": "البرنامج الخفي لـ IPFS غير متصل. يرجى تشغيله وإعادة المحاولة.",
"settingsUnavailable": "الإعدادات غير متاحة. يرجى التحقق من تشغيل البرنامج الخفي الخاص بـ IPFS.",
"settingsHaveChanged": "تم تغيير الإعدادات ؛ يرجى النقر فوق <1> إعادة تعيين </1> لتحديث محتويات المحرر.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/cs/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Vypnout"
},
"fetchingSettings": "Získávání nastavení...",
"configApiNotAvailable": "IPFS API nastavení není dostupný. Prosím vypněte rozšíření \"IFPS Companion\" a zkuste to znovu.",
"ipfsDaemonOffline": "Démon IPFS je offline. Zapněte jej a zkuste to znovu.",
"settingsUnavailable": "Nastavení není dostupný. Prosím zkontrolujte zdali běží IPFS služba.",
"settingsHaveChanged": "Nastavení se změnilo; kliknutím na <1>Obnovit</1> aktualizujte obsah editoru.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/da/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"close": "Luk"
},
"fetchingSettings": "Henter indstillinger...",
"configApiNotAvailable": "API'et til konfiguration af IPFS er utilgængelig. Venligst, fjern \"IPFS Kompagnon\" web-udvidelsen og prøv igen.",
"ipfsDaemonOffline": "IPFS baggrunds-processen er offline. Forsøg at starte den og prøv igen.",
"settingsUnavailable": "Indstillinger er ikke tilgængelige. Venligst, tjek at IPFS baggrunds-processen kører.",
"settingsHaveChanged": "Indstillingerne er opdateret, venligst klik på <1>Nulstil</1> for at opdatere editorens indhold.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/de/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Aus"
},
"fetchingSettings": "Einstellungen werden geladen...",
"configApiNotAvailable": "Die API zur IPFS-Konfigurations ist nicht verfügbar. Bitte deaktiviere die Browser-Erweiterung \"IPFS Companion\" und versuche es erneut.",
"ipfsDaemonOffline": "Der IPFS Daemon ist offline. Bitte starten Sie ihn und versuchen es erneut.",
"settingsUnavailable": "Einstellungen nicht verfügbar. Bitte überprüfe, ob Dein IPFS-Daemon läuft.",
"settingsHaveChanged": "Die Einstellungen haben sich geändert. Bitte klicke auf <1>Zurücksetzen</1>, um den Inhalt des Editors zu aktualisieren.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Off"
},
"fetchingSettings": "Fetching settings...",
"configApiNotAvailable": "The IPFS config API is not available. Please disable the \"IPFS Companion\" Web Extension and try again.",
"ipfsDaemonOffline": "The IPFS daemon is offline. Please turn it on and try again.",
"settingsUnavailable": "Settings not available. Please check your IPFS daemon is running.",
"settingsHaveChanged": "The settings have changed; please click <1>Reset</1> to update the editor contents.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/es/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"apiDescription": "<0>If your node is configured with a <1>custom API address</1>, including a port other than the default 5001, enter it here.</0>",
"cliDescription": "<0>Enable this option to display a \"view code\" <1></1> icon next to common IPFS commands. Clicking it opens a modal with that command's CLI code, so you can paste it into the IPFS command-line interface in your terminal.</0>",
"fetchingSettings": "Recuperando ajustes...",
"configApiNotAvailable": "La API de configuración de IPFS no está disponible. Desactive la Extensión Web \"IPFS Companion\" e inténtelo de nuevo.",
"ipfsDaemonOffline": "El demonio IPFS está fuera de línea. Enciéndalo e intente nuevamente.",
"settingsUnavailable": "Configuración no disponible. Por favor, compruebe que su servicio IPFS se está ejecutando.",
"settingsHaveChanged": "La configuración ha cambiado; haga clic en <1>Restablecer</1> para actualizar el contenido del editor. ",
Expand Down
1 change: 0 additions & 1 deletion public/locales/fr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Éteint"
},
"fetchingSettings": "Récupération des paramètres...",
"configApiNotAvailable": "L'API de configuration IPFS n'est pas disponible. Merci de désactiver l'extension IPFS Companion et de réessayer.",
"ipfsDaemonOffline": "Le daemon IPFS est hors-ligne. Merci de le relancer.",
"settingsUnavailable": "Paramètres non disponibles. Merci de vérifier que votre daemon IPFS est en cours d'exécution.",
"settingsHaveChanged": "Les paramètres ont changé. Cliquez sur <1>Réinitialiser</1> pour mettre à jour l'éditeur de contenu.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/id/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Mati"
},
"fetchingSettings": "Mengambil setelan...",
"configApiNotAvailable": "API konfigurasi IPFS tidak tersedia. Harap nonaktifkan Ekstensi Web \"Sahabat IPFS\" dan coba lagi.",
"ipfsDaemonOffline": "Daemon IPFS sedang offline. Harap aktifkan dan coba lagi.",
"settingsUnavailable": "Pengaturan tidak tersedia. Silakan periksa daemon IPFS Anda sedang berjalan.",
"settingsHaveChanged": "Pengaturan telah berubah; silakan klik <1>Reset</1> untuk memperbarui konten editor.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/it/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Off"
},
"fetchingSettings": "Recupero delle impostazioni...",
"configApiNotAvailable": "L'IPFS config API non è disponibile. Per favore, disabilita l'estensione web \"IPFS Companion\" e riprova.",
"ipfsDaemonOffline": "Il demone IPFS è offline. Per favore, avvialo e riprova.",
"settingsUnavailable": "Impostazioni non disponibili. Per favore, controlla che il tuo demone IPFS sia attivo.",
"settingsHaveChanged": "Le impostazioni sono cambiate; per favore, clicca <1>Ripristina</1> per aggiornare il contenuto dell'editor.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/ja-JP/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "オフ"
},
"fetchingSettings": "設定を読み込んでいます…",
"configApiNotAvailable": "IPFS設定APIが利用できません。拡張機能「IPFS Companion」を無効にして再度接続を試してください。",
"ipfsDaemonOffline": "IPFSデーモンが起動していないようです。デーモンを起動して再度接続を試してください。",
"settingsUnavailable": "設定を読み込めません。IPFSデーモンが起動していることを確認してください。",
"settingsHaveChanged": "設定が変更されました。<1>リセット</1>をクリックして編集しているファイルを再読み込みしてください。",
Expand Down
1 change: 0 additions & 1 deletion public/locales/nl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"close": "Sluiten"
},
"fetchingSettings": "Bezig met ophalen van instellingen....",
"configApiNotAvailable": "De IPFS configuratie API is niet beschikbaar. Schakel de \"IPFS Compantion\" extensie uit en probeer opnieuw.",
"settingsUnavailable": "Instellingen niet beschikbaar. Check of de IPFS daemon draait.",
"settingsHaveChanged": "De instellingen zijn gewijzigd, klik <1>reset</1> om de inhoud te verversen",
"errorOccured": "Er is een fout opgereden tijdens het opslaan van de wijzigingen",
Expand Down
1 change: 0 additions & 1 deletion public/locales/no/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"close": "Lukk"
},
"fetchingSettings": "Henter innstillinger...",
"configApiNotAvailable": "IPFS sitt konfigurasjons API er ikke tilgjengelig. Vennligst deaktiver \"IPFS Companion\" Web extension, og prøv på nytt.",
"ipfsDaemonOffline": "IPFS-daemon er offline. Vennligst skru den på og prøv på nytt.",
"settingsUnavailable": "Innstillinger ikke tilgjengelig. Vennligst sjekk at din IPFS daemon kjører.",
"settingsHaveChanged": "Innstillingene er endret, vennligst klikk <1>Tilbakestill</1> for å oppdatere editor innholdet",
Expand Down
1 change: 0 additions & 1 deletion public/locales/pl/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Wyłączone"
},
"fetchingSettings": "Pobieranie ustawień... \n",
"configApiNotAvailable": "API konfiguracji IPFS nie jest dostępne. Proszę wyłączyć rozszerzenie \"IPFS Companion\" i spróbować ponownie.",
"ipfsDaemonOffline": "Demon IPFS jest w trybie offline. Proszę włączyć go i spróbować ponownie. ",
"settingsUnavailable": "Ustawienia nie są dostępne. Proszę sprawdzić, czy demon IPFS jest uruchomiony.",
"settingsHaveChanged": "Ustawienia uległy zmianie; proszę kliknąć <1>Resetuj</1> t aby zaktualizować zawartość edytora.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/pt/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"close": "Fechar"
},
"fetchingSettings": "A obter as configurações...",
"configApiNotAvailable": "A API de configuração do IPFS não está disponível. Por favor desative a extensão \"IPFS Companion\" e tente novamente.",
"ipfsDaemonOffline": "O nó IPFS está offline. Por favor ative-o e tente novamente,",
"settingsUnavailable": "As configurações não estão disponíveis. Confira, por favor, se o seu nó IPFS está em execução.",
"settingsHaveChanged": "As configurações foram alteradas, por favor clique em <1>Começar de novo</1> para atualizar os conteúdos do editor.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/ru/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Выкл"
},
"fetchingSettings": "Получение настроек...",
"configApiNotAvailable": "API настройки IPFS недоступно. Пожалуйста, отключите веб-расширение \"IPFS-компаньон\" и попробуйте снова.",
"ipfsDaemonOffline": "Служба IPFS отключена. Пожалуйста, включите ее и попробуйте снова.",
"settingsUnavailable": "Настройки недоступны. Убедитесь, что у вас запущена IPFS - служба.",
"settingsHaveChanged": "Настройки были изменены; пожалуйста, нажмите <1>Сброс</1>, чтобы обновить измененный контент.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/tr/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "Kapalı"
},
"fetchingSettings": "Ayarlar getiriliyor ...",
"configApiNotAvailable": "IPFS yapılandırma UPA'sı mevcut değildir. Lütfen \"IPFS Companion\" Web Uzantısını devre dışı bırakın ve tekrar deneyin.",
"ipfsDaemonOffline": "IPFS arka plan programı çevrimdışı. Lütfen açın ve tekrar deneyin.",
"settingsUnavailable": "Ayarlar mevcut değil. Lütfen IPFS daemonunuzun çalışıp çalışmadığını kontrol edin.",
"settingsHaveChanged": "Ayarlar değişti; editör içeriğini güncellemek için lütfen <1>Sıfırla</1>'yı tıklayın.",
Expand Down
1 change: 0 additions & 1 deletion public/locales/zh-CN/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": ""
},
"fetchingSettings": "拉取配置中 ...",
"configApiNotAvailable": "IPFS 配置 API 不可用。请禁用 \"IPFS 伴侣\" 浏览器插件并重试。",
"ipfsDaemonOffline": "IPFS 守护进程处于离线状态,请使其在线并重试。",
"settingsUnavailable": "配置不可用,请检查你的 IPFS 守护进程是否还在运行。",
"settingsHaveChanged": "配置已经改变,请单击 <1>重置</1> 按钮刷新编辑器中的内容。",
Expand Down
1 change: 0 additions & 1 deletion public/locales/zh-TW/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@
"false": "關閉"
},
"fetchingSettings": "正在擷取設定...",
"configApiNotAvailable": "IPFS 設定 API 無法使用。請停用「IPFS 小幫手」網頁擴充功能並再試一次。",
"ipfsDaemonOffline": "IPFS Daemon 已離線。請開啟並再試一次。",
"settingsUnavailable": "設定無法使用。請檢查你的 IPFS Daemon 是否正在執行。",
"settingsHaveChanged": "設定已經變更,請按<1>重設</1> 更新編輯器內容。",
Expand Down
7 changes: 0 additions & 7 deletions src/bundles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ bundle.selectBootstrapPeers = createSelector(
(config) => config && config.Bootstrap
)

// TODO: this is a work-around for IPFS companion blocking the config API
// see: https://github.com/ipfs-shipyard/ipfs-companion/issues/454
bundle.selectIsConfigBlocked = createSelector(
'selectConfigRaw',
({ errorType }) => errorType === 'Access to config.get API is globally blocked for window.ipfs'
)

// Fetch the config if we don't have it or it's more than `staleAfter` ms old
bundle.reactConfigFetch = createSelector(
'selectConfigShouldUpdate',
Expand Down
17 changes: 4 additions & 13 deletions src/settings/SettingsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const PAUSE_AFTER_SAVE_MS = 3000

export const SettingsPage = ({
t, tReady, isIpfsConnected, ipfsPendingFirstConnection, isIpfsDesktop,
isConfigBlocked, isLoading, isSaving, arePinningServicesSupported,
isLoading, isSaving, arePinningServicesSupported,
hasSaveFailed, hasSaveSucceded, hasErrors, hasLocalChanges, hasExternalChanges,
config, onChange, onReset, onSave, editorKey, analyticsEnabled, doToggleAnalytics,
toursEnabled, handleJoyrideCallback, isCliTutorModeEnabled, doToggleCliTutorMode, command
Expand Down Expand Up @@ -128,7 +128,6 @@ export const SettingsPage = ({
tReady={tReady}
config={config}
isIpfsConnected={isIpfsConnected}
isConfigBlocked={isConfigBlocked}
isLoading={isLoading}
hasExternalChanges={hasExternalChanges}
hasSaveFailed={hasSaveFailed}
Expand Down Expand Up @@ -209,14 +208,8 @@ const SaveButton = ({ t, hasErrors, hasSaveFailed, hasSaveSucceded, isSaving, ha
)
}

const SettingsInfo = ({ t, isIpfsConnected, isConfigBlocked, hasExternalChanges, hasSaveFailed, hasSaveSucceded, isLoading, config }) => {
if (isConfigBlocked) {
return (
<p className='ma0 lh-copy charcoal f5 mw7'>
{t('configApiNotAvailable')}
</p>
)
} else if (!isIpfsConnected) {
const SettingsInfo = ({ t, isIpfsConnected, hasExternalChanges, hasSaveFailed, hasSaveSucceded, isLoading, config }) => {
if (!isIpfsConnected) {
return (
<p className='ma0 lh-copy charcoal f5 mw7'>
{t('ipfsDaemonOffline')}
Expand Down Expand Up @@ -329,7 +322,7 @@ export class SettingsPageContainer extends React.Component {

render () {
const {
t, tReady, isConfigBlocked, ipfsConnected, configIsLoading, configLastError, configIsSaving, arePinningServicesSupported,
t, tReady, ipfsConnected, configIsLoading, configLastError, configIsSaving, arePinningServicesSupported,
configSaveLastSuccess, configSaveLastError, isIpfsDesktop, analyticsEnabled, doToggleAnalytics, toursEnabled,
handleJoyrideCallback, isCliTutorModeEnabled, doToggleCliTutorMode, ipfsPendingFirstConnection
} = this.props
Expand All @@ -344,7 +337,6 @@ export class SettingsPageContainer extends React.Component {
tReady={tReady}
isIpfsConnected={ipfsConnected}
ipfsPendingFirstConnection={ipfsPendingFirstConnection}
isConfigBlocked={isConfigBlocked}
isLoading={isLoading}
isSaving={configIsSaving}
arePinningServicesSupported={arePinningServicesSupported}
Expand Down Expand Up @@ -377,7 +369,6 @@ export default connect(
'selectConfig',
'selectIpfsConnected',
'selectIpfsPendingFirstConnection',
'selectIsConfigBlocked',
'selectConfigLastError',
'selectConfigIsLoading',
'selectConfigIsSaving',
Expand Down

0 comments on commit e2495dd

Please sign in to comment.