Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Send Ban Notification #13

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/js/content-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -1973,11 +1973,13 @@ async function banClick(event) {
console.debug('banClick:', pid, event)
await banPlayer(pid)
const player = await getProfile(pid)
await sendChatMessage(`Banned User: ${player.username}`)
// TODO: Make this an option
// if (options.autoKickBanned) {
// await kickPlayer(pid)
// }
if (window.location.pathname.includes('room')) {
// TODO: Make this an Option
await sendChatMessage(`Banned User: ${player.username}`)
}
if (options.autoKickBanned) {
await kickPlayer(pid)
}
history.back()
}

Expand Down
2 changes: 1 addition & 1 deletion src/js/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ async function onUpdate(tabId, changeInfo, tab) {
// console.debug('onUpdate: tabId, changeInfo, tab:', tabId, changeInfo, tab)
if (changeInfo.url?.includes('playdrift.com')) {
try {
const response = await chrome.tabs.sendMessage(tabId, {
await chrome.tabs.sendMessage(tabId, {
url: changeInfo.url,
})
// console.debug('response:', response)
Expand Down