Skip to content

Commit

Permalink
Fixed another edge case in NCH script preventing highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
WombatFromHell committed Feb 29, 2024
1 parent c9801cf commit bd0b847
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chromeshack",
"version": "1.76.0",
"version": "1.77.0",
"description": "Collection of scripts for Shacknews.",
"repository": "https://github.com/latestchatty/chromeshack",
"type": "module",
Expand Down
21 changes: 17 additions & 4 deletions public/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,23 @@

<body>
<h1>Chrome Shack Release Notes</h1>
<h2>Version 1.77</h2>
<ul>
<li>Fixed: "Highlight New Posts" not highlighting when manually refreshing a thread (WombatFromHell)</li>
</ul>
<h2>Version 1.76</h2>
<ul>
<li>Added: a "Core" tab in the settings panel enabling toggling of previously non-optional scripts (WombatFromHell)</li>
<li>
Added: a "Core" tab in the settings panel enabling toggling of previously non-optional scripts (WombatFromHell)
</li>
<li>Changed: "Settings" the Reset button now forces an extension reload when used (WombatFromHell)</li>
<li>Fixed: "Highlight New Posts" squashed another bug causing excessive highlighting due to invalid timestamp (WombatFromHell)</li>
<li>Fixed: handlePostRefresh handler causing excessive reloads/scrolling of user-submitted replies (WombatFromHell)</li>
<li>
Fixed: "Highlight New Posts" squashed another bug causing excessive highlighting due to invalid timestamp
(WombatFromHell)
</li>
<li>
Fixed: handlePostRefresh handler causing excessive reloads/scrolling of user-submitted replies (WombatFromHell)
</li>
</ul>
<h2>Version 1.75</h2>
<ul>
Expand All @@ -34,7 +45,9 @@ <h2>Version 1.75</h2>
<li>Added: "Media Embedder" now supports Youtube Shorts embeds (WombatFromHell)</li>
<li>Added: "Media Embedder" now supports long-form Youtube Playlist embeds (WombatFromHell)</li>
<li>Changed: Made Popup and new Firefox permissions panel dark/light mode responsive (WombatFromHell)</li>
<li>Fixed: "Drafts" wiping existing drafts when interacting with reply box in some situations (WombatFromHell)</li>
<li>
Fixed: "Drafts" wiping existing drafts when interacting with reply box in some situations (WombatFromHell)
</li>
<li>Fixed: "Settings Popup" now reloads the extension automatically when importing settings (WombatFromHell)</li>
<li>Fixed: "Scroll To Single Thread Fix" misbehaving and scrolling the main Chatty (WombatFromHell)</li>
<li>Fixed: "Custom User Filters" not consistently applying filters on reloads (WombatFromHell)</li>
Expand Down
2 changes: 1 addition & 1 deletion src/manifestv3.ffx.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Chrome Shack",
"version": "1.76",
"version": "1.77",
"description": "Collection of scripts for Shacknews.",
"browser_specific_settings": {
"gecko": {
Expand Down
6 changes: 4 additions & 2 deletions src/optional/new_comment_highlighter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ export const NewCommentHighlighter = {
},

async highlight(args?: PostEventArgs) {
const { root } = args || {};
const { root, rootid } = args || {};
const isEnabled = await enabledContains(["new_comment_highlighter"]);
if (!isEnabled) return;

const recents = NewCommentHighlighter.getRecentsCache();

const lastIds = (await getSetting("new_comment_highlighter_last_id", {})) as Record<number, number>;
const lastId: number = Object.keys(lastIds).length ? Math.max(...Object.values(lastIds)) : -1;
const lastIdsLen = Object.keys(lastIds).length;
const lastId =
lastIdsLen && root && lastIds[rootid] ? lastIds[rootid] : lastIdsLen ? Math.max(...Object.values(lastIds)) : -1;
const newId = NewCommentHighlighter.getRecentId(root);
let staleId = false;

Expand Down

0 comments on commit bd0b847

Please sign in to comment.