fix(ui): could not submit pin due to localization updates (#2324)
Co-authored-by: Elia Zammuto <theelixzammuto@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
</body>
|
</body>
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {createApp} from 'vue'
|
import { createApp } from 'vue'
|
||||||
import i18n from './locale.js'
|
import i18n from './locale.js'
|
||||||
import Navbar from './Navbar.vue'
|
import Navbar from './Navbar.vue'
|
||||||
|
|
||||||
@@ -37,8 +37,8 @@
|
|||||||
i18n().then(i18n => {
|
i18n().then(i18n => {
|
||||||
app.use(i18n);
|
app.use(i18n);
|
||||||
app.mount('#app');
|
app.mount('#app');
|
||||||
});
|
|
||||||
|
|
||||||
|
// this must be after mounting the app
|
||||||
document.querySelector("#form").addEventListener("submit", (e) => {
|
document.querySelector("#form").addEventListener("submit", (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
let pin = document.querySelector("#pin-input").value;
|
let pin = document.querySelector("#pin-input").value;
|
||||||
@@ -50,13 +50,14 @@
|
|||||||
if (response.status.toString().toLowerCase() === "true") {
|
if (response.status.toString().toLowerCase() === "true") {
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
"#status"
|
"#status"
|
||||||
).innerHTML = `<div class="alert alert-success" role="alert">$t('pin.pair_success')</div>`;
|
).innerHTML = `<div class="alert alert-success" role="alert">${i18n.global.t('pin.pair_success')}</div>`;
|
||||||
document.querySelector("#pin-input").value = "";
|
document.querySelector("#pin-input").value = "";
|
||||||
} else {
|
} else {
|
||||||
document.querySelector(
|
document.querySelector(
|
||||||
"#status"
|
"#status"
|
||||||
).innerHTML = `<div class="alert alert-danger" role="alert">$t('pin.pair_failure')</div>`;
|
).innerHTML = `<div class="alert alert-danger" role="alert">${i18n.global.t('pin.pair_failure')}</div>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user