feat: improve layout

This commit is contained in:
Wlad Meixner 2023-01-08 03:40:37 +01:00
parent 0977bc9ca6
commit 4f5b361acb
2 changed files with 25 additions and 1 deletions

View File

@ -40,7 +40,7 @@
.loading-overlay { .loading-overlay {
position: absolute; position: absolute;
top: 0; top: 0;
left: 25%; left: 17%;
bottom: 0; bottom: 0;
display: flex; display: flex;

View File

@ -18,12 +18,36 @@
return; return;
} }
const payload = {}; const payload = {};
notifyMe();
// TODO: adjust URL // TODO: adjust URL
const resp = await fetch('/api/interpretLaw'); const resp = await fetch('/api/interpretLaw');
updateFinished = true; updateFinished = true;
}; };
const notifyMe = () => {
if (!('Notification' in window)) {
// Check if the browser supports notifications
alert('This browser does not support desktop notification');
} else if (Notification.permission === 'granted') {
// Check whether notification permissions have already been granted;
// if so, create a notification
const notification = new Notification('Hi there!');
// …
} else if (Notification.permission !== 'denied') {
// We need to ask the user for permission
Notification.requestPermission().then((permission) => {
// If the user accepts, let's create a notification
if (permission === 'granted') {
const notification = new Notification('Hi there!');
}
});
}
// At last, if the user has denied notifications, and you
// want to be respectful there is no need to bother them anymore.
};
onMount(() => { onMount(() => {
updateCompanyData().finally(() => { updateCompanyData().finally(() => {
updateFinished = true; updateFinished = true;