mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-10 01:03:36 -05:00
Merge branch 'master' of https://github.com/revoltchat/revite
This commit is contained in:
commit
57ecf4638e
2 changed files with 35 additions and 4 deletions
|
@ -54,7 +54,29 @@ export default function Invite() {
|
|||
<div className={styles.preloader}>
|
||||
<RequiresOnline>
|
||||
{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" />
|
||||
)}
|
||||
|
|
15
src/sw.ts
15
src/sw.ts
|
@ -11,10 +11,19 @@ precacheAndRoute(self.__WB_MANIFEST);
|
|||
|
||||
self.addEventListener("push", (event) => {
|
||||
async function process() {
|
||||
if (event.data === null) return;
|
||||
// Need to write notification generator on server.
|
||||
}
|
||||
if (event.data) {
|
||||
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());
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue