-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add context menu to open sidebar when button is missing due to Rumble…
… changes
- Loading branch information
1 parent
99a705e
commit 93331eb
Showing
7 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { openRantsButtonHandler } from "./components/open-chat/open-chat" | ||
import { getVideoID } from "./components/rumble/rumble" | ||
|
||
/** | ||
* Open sidebar | ||
*/ | ||
export const openSidebar = (): void => { | ||
const videoId = getVideoID() | ||
if (videoId === "") { | ||
return | ||
} | ||
|
||
const chatHistory = document.getElementsByClassName("chat-history") | ||
if (chatHistory.length === 0) { | ||
// eslint-disable-next-line no-alert | ||
window.alert("Video is not a live stream or no chat history. No Rants to show.") | ||
return // not a live feed | ||
} | ||
|
||
openRantsButtonHandler(videoId).then() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters