Add FCM device registration and Gitea bug reporter
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
(() => {
|
||||
const form = document.querySelector('.bug-report-form');
|
||||
if (!form) return;
|
||||
const cap = window.Capacitor;
|
||||
if (cap?.getPlatform() === 'android') {
|
||||
document.getElementById('bug-platform').value = 'Android';
|
||||
cap.Plugins.MetalCircleDevice?.getInfo().then(info => {
|
||||
document.getElementById('bug-app-version').value = info.appVersion || '';
|
||||
}).catch(() => {});
|
||||
}
|
||||
form.addEventListener('submit', () => { form.querySelector('button[type="submit"]').disabled = true; });
|
||||
window.addEventListener('pageshow', event => { if (event.persisted) location.reload(); });
|
||||
})();
|
||||
Reference in New Issue
Block a user