Skip to content

Commit

Permalink
Blink is blocking requests from file://. When accessed offline, put a…
Browse files Browse the repository at this point in the history
… link to the website instead of the form to register email
  • Loading branch information
Flaburgan committed Feb 26, 2025
1 parent b414270 commit 4adf371
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 5 additions & 1 deletion components/email-registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export default function EmailRegistration() {
return false;
};

return (
// Blink (Used by QtWebEngine, used by Ubuntu Touch) is blocking requests from file:// with CORS. If we are offline, we display a link
// to the website instead of the form (even if it does work with Firefox)
return window.location.protocol === "file:" ?
<p><Trans>Access <a href="https://disco2very.org" target="_blank" rel="noreferrer">disCO<sub>2</sub>very</a> online to subscribe.</Trans></p> :
(
<div>
<form method="post" action="https://www.disco2very.org/server/" id="register-email" onSubmit={onSubmit}>
<input type="email" name="email" placeholder={t`[email protected]`} autoComplete="email" required />
Expand Down
10 changes: 7 additions & 3 deletions locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgstr "{email} is not a valid email address."
msgid "A real deck of cards?"
msgstr "A real deck of cards?"

#: components/email-registration.tsx:40
msgid "Access <0>disCO<1>2</1>very</0> online to subscribe."
msgstr "Access <0>disCO<1>2</1>very</0> online to subscribe."

#: components/board.tsx:133
#: components/categories-selector.tsx:55
msgid "Back"
Expand Down Expand Up @@ -94,7 +98,7 @@ msgstr "love"
msgid "Made with <0/> by <1>Fla</1> & Sara."
msgstr "Made with <0/> by <1>Fla</1> & Sara."

#: components/email-registration.tsx:42
#: components/email-registration.tsx:44
msgid "[email protected]"
msgstr "[email protected]"

Expand All @@ -118,11 +122,11 @@ msgstr "Place the cards in the correct order guessing their CO<0>2</0> footprint
msgid "Play again"
msgstr "Play again"

#: components/email-registration.tsx:51
#: components/email-registration.tsx:53
msgid "Please contact fla (a) framasoft.org to unregister"
msgstr "Please contact fla (a) framasoft.org to unregister"

#: components/email-registration.tsx:44
#: components/email-registration.tsx:46
msgid "Register"
msgstr "Register"

Expand Down
10 changes: 7 additions & 3 deletions locales/fr/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ msgstr "{email} n'est pas une adresse e-mail valide."
msgid "A real deck of cards?"
msgstr "Un vrai jeu de cartes ?"

#: components/email-registration.tsx:40
msgid "Access <0>disCO<1>2</1>very</0> online to subscribe."
msgstr "Allez sur <0>disCO<1>2</1>very</0> en ligne pour vous enregistrer."

#: components/board.tsx:133
#: components/categories-selector.tsx:55
msgid "Back"
Expand Down Expand Up @@ -94,7 +98,7 @@ msgstr "amour"
msgid "Made with <0/> by <1>Fla</1> & Sara."
msgstr "Fait avec <0/> par <1>Fla</1> & Sara."

#: components/email-registration.tsx:42
#: components/email-registration.tsx:44
msgid "[email protected]"
msgstr "[email protected]"

Expand All @@ -118,11 +122,11 @@ msgstr "Placez les cartes dans le bon ordre en estimant leur empreinte CO<0>2</0
msgid "Play again"
msgstr "Rejouer"

#: components/email-registration.tsx:51
#: components/email-registration.tsx:53
msgid "Please contact fla (a) framasoft.org to unregister"
msgstr "Merci de contacter fla (a) framasoft.org pour vous désinscrire"

#: components/email-registration.tsx:44
#: components/email-registration.tsx:46
msgid "Register"
msgstr "S'inscrire"

Expand Down

0 comments on commit 4adf371

Please sign in to comment.