This commit is contained in:
Paul 2021-09-03 11:15:07 +01:00
commit 57ecf4638e
2 changed files with 35 additions and 4 deletions

View file

@ -54,7 +54,29 @@ export default function Invite() {
<div className={styles.preloader}> <div className={styles.preloader}>
<RequiresOnline> <RequiresOnline>
{error ? ( {error ? (
<Overline type="error" error={error} /> <div
className={styles.invite}
style={{
backgroundImage: `url('https://autumn.revolt.chat/banners/yMurJiXf45VJpbal0X2zQkm4vaXsXGaRtoPUIcvPcH')`,
width: "100%",
height: "100%",
}}>
<div className={styles.details}>
<h1>Invalid invite!</h1>
<h2>
The invite may not exist or you don't have
permission to join.
</h2>
<div style="cursor: pointer;">
<Button contrast>
<ArrowBack
size={32}
onClick={() => history.push("/")}
/>
</Button>
</div>
</div>
</div>
) : ( ) : (
<Preloader type="spinner" /> <Preloader type="spinner" />
)} )}

View file

@ -11,10 +11,19 @@ precacheAndRoute(self.__WB_MANIFEST);
self.addEventListener("push", (event) => { self.addEventListener("push", (event) => {
async function process() { async function process() {
if (event.data === null) return; if (event.data) {
// Need to write notification generator on server. const data = event.data.json();
} await self.registration.showNotification(data.author, {
icon: data.icon,
image: data.image,
body: data.body,
timestamp: data.timestamp,
tag: data.tag,
badge: "https://app.revolt.chat/assets/icons/android-chrome-512x512.png"
});
}
}
event.waitUntil(process()); event.waitUntil(process());
}); });