mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-29 02:10:59 -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}>
|
<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" />
|
||||||
)}
|
)}
|
||||||
|
|
15
src/sw.ts
15
src/sw.ts
|
@ -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());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue