Skip to content
Snippets Groups Projects
Commit 5a2350b7 authored by insert's avatar insert
Browse files

Fix import and pass through URL.

parent 8a0d90e2
Branches
Tags
No related merge requests found
/// <reference lib="webworker" /> /// <reference lib="webworker" />
import { Channel, Message, SYSTEM_USER_ID, User } from 'revolt.js'
import { precacheAndRoute } from 'workbox-precaching' import { precacheAndRoute } from 'workbox-precaching'
import { Server } from 'revolt.js/dist/api/objects' import { Server } from 'revolt.js/dist/api/objects'
import { Channel, Message, User } from 'revolt.js'
import { IDBPDatabase, openDB } from 'idb' import { IDBPDatabase, openDB } from 'idb'
import { decodeTime } from 'ulid' import { decodeTime } from 'ulid'
...@@ -62,7 +62,7 @@ self.addEventListener("push", event => { ...@@ -62,7 +62,7 @@ self.addEventListener("push", event => {
case "SavedMessages": break; case "SavedMessages": break;
case "DirectMessage": title = `@${username}`; break; case "DirectMessage": title = `@${username}`; break;
case "Group": case "Group":
if (user?._id === SYSTEM_USER_ID) { if (user?._id === '00000000000000000000000000') {
title = channel.name; title = channel.name;
} else { } else {
title = `@${user?.username} - ${channel.name}`; title = `@${user?.username} - ${channel.name}`;
...@@ -82,7 +82,8 @@ self.addEventListener("push", event => { ...@@ -82,7 +82,8 @@ self.addEventListener("push", event => {
body: typeof data.content === "string" ? data.content : JSON.stringify(data.content), body: typeof data.content === "string" ? data.content : JSON.stringify(data.content),
timestamp: decodeTime(data._id), timestamp: decodeTime(data._id),
tag: data.channel, tag: data.channel,
badge: "https://app.revolt.chat/assets/icons/android-chrome-512x512.png" badge: "https://app.revolt.chat/assets/icons/android-chrome-512x512.png",
data: channel?.channel_type === 'TextChannel' ? `/server/${channel.server}/channel/${channel._id}` : `/channel/${data.channel}`
}); });
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment