Skip to content

Commit

Permalink
Hide twitch.tv announcement banners, disable creating new ones and le…
Browse files Browse the repository at this point in the history
…t them know that they simply need to start streaming under the appropriate categories / tags
  • Loading branch information
anoek committed Jun 24, 2024
1 parent c9f12c1 commit 2ce39af
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/components/Announcements/ActiveAnnouncements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,18 @@ export class ActiveAnnouncements extends React.PureComponent {
const creator_blocked = getBlocks(announcement.creator.id).block_announcements;
const type_muted = announcementTypeMuted(announcement);

/* No longer show twitch announcements, they'll show up automatically on GoTV */
let is_twitch = false;
if (announcement.link && announcement.link.toLowerCase().indexOf("twitch.tv") > 0) {
is_twitch = true;
}

if (
announcement.type !== "tournament" &&
!is_hidden &&
!creator_blocked &&
!type_muted
!type_muted &&
!is_twitch
) {
lst.push(announcement);
}
Expand Down
8 changes: 8 additions & 0 deletions src/components/Announcements/Announcements.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ export class Announcements extends React.PureComponent<{}, AnnouncementsState> {
return null;
}

/* No longer show twitch announcements, they'll show up automatically on GoTV */
if (
announcement.link &&
announcement.link.toLowerCase().indexOf("twitch.tv") > 0
) {
return null;
}

return (
<div className="announcement" key={idx}>
<i className="fa fa-times-circle" onClick={announcement.clear} />
Expand Down
21 changes: 20 additions & 1 deletion src/views/AnnouncementCenter/AnnouncementCenter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ export function AnnouncementCenter(): JSX.Element {
del(`announcements/${announcement.id}`).then(refresh).catch(errorAlerter);
};

const can_create = !!text;
let can_create = true;

can_create &&= !!text;

if (link && link.toLowerCase().indexOf("twitch.tv") > 0) {
can_create = false;
}

return (
<div className="AnnouncementCenter container">
Expand Down Expand Up @@ -206,6 +212,19 @@ export function AnnouncementCenter(): JSX.Element {
</button>
</dd>
</dl>

{link && link.toLowerCase().indexOf("twitch.tv") >= 0 && (
<div style={{ color: "orange" }}>
{/* untranslated on purpose, we should be moving away
from streamers needing to self announce in most
cases */}
Note: Announcing twitch.tv streams is no longer necessary as they'll
automatically be picked up and displayed with the GoTV system. To use the
GoTV system, simply start streaming on twitch.tv and set your category to
Go, or Board Games and use the #go, #weiqi, or #baduk tags.
</div>
)}

<div className="announcements">
{announcements.map((announcement, idx) => (
<div className="announcement" key={idx}>
Expand Down

0 comments on commit 2ce39af

Please sign in to comment.