Skip to content

Commit 42dfa2d

Browse files
committed
v0.1.0
1 parent 7f4c46f commit 42dfa2d

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "synclify",
33
"displayName": "Synclify",
4-
"version": "0.0.5",
4+
"version": "0.1.0",
55
"description": "Create a watch party straight from your browser—works anywhere, ad-free.",
66
"author": "andrea",
77
"scripts": {

src/background/messages/inject.ts

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const handler: PlasmoMessaging.MessageHandler = async (_req, res) => {
2222
.filter((injection) => injection.result)
2323
.map((injection) => injection.frameId)
2424

25-
console.log(frameIds)
2625
// inject content script only in frames that have video
2726
await browser.scripting.executeScript({
2827
files: [filename],

src/background/messages/showToast.ts

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const handler: PlasmoMessaging.MessageHandler = async (req, _res) => {
1111
content: req.body.content,
1212
show: req.body.show ?? true
1313
})
14-
console.log("Received message")
1514
_res.send(null)
1615
}
1716

src/contents/autoInject.ts

-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const observer = new MutationObserver((mutations) => {
1515
)
1616
)
1717
) {
18-
console.log("injecting again")
1918
sendToBackground({ name: "shouldInject" }).then((res: boolean) => {
20-
console.log("shouldInject", res)
2119
if (res) sendToBackground({ name: "inject" })
2220
})
2321
}

src/contents/toast.tsx

+14-12
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/ban-ts-comment */
21
import { useEffect, useState } from "react"
32

43
import type { PlasmoGetStyle } from "plasmo"
@@ -18,35 +17,38 @@ const PlasmoOverlay = () => {
1817
const [error, setError] = useState(false)
1918

2019
useEffect(() => {
21-
const callback = (msg: {
22-
to: string
23-
show: boolean
24-
content: string
25-
error: boolean
26-
}) => {
20+
const callback = (
21+
msg: {
22+
to: string
23+
show: boolean
24+
content: string
25+
error: boolean
26+
},
27+
_sender,
28+
sendResponse
29+
) => {
2730
if (msg.to === "toast") {
2831
if (msg.show) {
2932
setError(msg.error)
3033
setContent(msg.content)
3134
setShow(msg.show)
3235
setTimeout(() => setShow(false), 2000)
3336
} else setShow(false)
34-
return false
37+
sendResponse(null)
38+
return true
3539
}
3640
}
37-
// @ts-ignore
3841
browser.runtime.onMessage.addListener(callback)
3942

4043
return () => {
41-
// @ts-ignore
4244
browser.runtime.onMessage.removeListener(callback)
4345
}
4446
}, [])
4547

4648
return (
4749
<div
48-
className={`fixed right-0 flex translate-x-40 rounded-l-2xl border-y border-l bg-opacity-20 p-3 opacity-0 backdrop-blur transition duration-300 ${
49-
show ? "translate-x-0 opacity-100" : ""
50+
className={`fixed right-0 flex rounded-l-2xl border-y border-l bg-opacity-20 p-3 opacity-0 backdrop-blur transition duration-300 ${
51+
show ? "translate-x-0 opacity-100" : "translate-x-40"
5052
} ${
5153
error ? "border-red-500 bg-red-500" : "border-green-400 bg-green-400"
5254
}`}>

0 commit comments

Comments
 (0)