Skip to content

Commit 00f5d6b

Browse files
authored
v0.5.7 - Improvements and Fixes (#230)
* feat: add biome configuration and improve Lockscreen component logic * fix: update ChannelItemUtils key check and improve warning message for missing components * chore: bump version to 0.5.7 and update changelog with improvements and fixes
1 parent 434c259 commit 00f5d6b

File tree

7 files changed

+134
-189
lines changed

7 files changed

+134
-189
lines changed

ShowHiddenChannels.plugin.js

Lines changed: 64 additions & 126 deletions
Large diffs are not rendered by default.

biome.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"files": {
3+
"ignore": [
4+
"ShowHiddenChannels.plugin.js"
5+
]
6+
}
7+
}

src/components/Lockscreen.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@ export const Lockscreen = React.memo(({ chat, channel, settings }) => {
3131
>
3232
<div className="shc-hidden-notice">
3333
<img
34+
alt='Hidden Channel Icon'
3435
style={{
3536
WebkitUserDrag: 'none',
3637
maxHeight: 128,
3738
margin: '0 auto',
3839
}}
3940
src={
40-
settings['hiddenChannelIcon'] == 'eye'
41+
settings.hiddenChannelIcon === 'eye'
4142
? 'https://raw.githubusercontent.com/JustOptimize/ShowHiddenChannels/main/assets/eye.png'
4243
: '/assets/755d4654e19c105c3cd108610b78d01c.svg'
4344
}
@@ -59,11 +60,11 @@ export const Lockscreen = React.memo(({ chat, channel, settings }) => {
5960
marginTop: 8,
6061
}}
6162
>
62-
You cannot see the contents of this channel. {channel.topic && channel.type != 15 && 'However, you may see its topic.'}
63+
You cannot see the contents of this channel. {channel.topic && channel.type !== 15 && 'However, you may see its topic.'}
6364
</TextElement>
6465
{/* Topic */}
6566
{channel.topic &&
66-
channel.type != 15 &&
67+
channel.type !== 15 &&
6768
(ChannelUtils?.renderTopic(channel, guild) || "ChannelUtils module is missing, topic won't be shown.")}
6869

6970
{/* Icon Emoji */}
@@ -82,7 +83,7 @@ export const Lockscreen = React.memo(({ chat, channel, settings }) => {
8283
{/* Slowmode */}
8384
{channel.rateLimitPerUser > 0 && (
8485
<TextElement color={TextElement.Colors.INTERACTIVE_NORMAL} size={TextElement.Sizes.SIZE_14}>
85-
Slowmode: {convertToHMS(channel.rateLimitPerUser)}
86+
Slowmode: {convertToHMS(Number(channel.rateLimitPerUser))}
8687
</TextElement>
8788
)}
8889

@@ -94,7 +95,7 @@ export const Lockscreen = React.memo(({ chat, channel, settings }) => {
9495
)}
9596

9697
{/* Bitrate */}
97-
{channel.bitrate && channel.type == 2 && (
98+
{channel.bitrate && channel.type === 2 && (
9899
<TextElement color={TextElement.Colors.INTERACTIVE_NORMAL} size={TextElement.Sizes.SIZE_14}>
99100
Bitrate: {channel.bitrate / 1000}kbps
100101
</TextElement>
@@ -119,7 +120,7 @@ export const Lockscreen = React.memo(({ chat, channel, settings }) => {
119120
)}
120121

121122
{/* Permissions */}
122-
{settings['showPerms'] && channel.permissionOverwrites && (
123+
{settings.showPerms && channel.permissionOverwrites && (
123124
<div
124125
style={{
125126
margin: '16px auto 0 auto',

src/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ShowHiddenChannels",
33
"displayName": "Show Hidden Channels (SHC)",
4-
"version": "0.5.6",
4+
"version": "0.5.7",
55
"author": "JustOptimize (Oggetto)",
66
"authorId": "619203349954166804",
77
"source": "https://github.com/JustOptimize/ShowHiddenChannels",

src/index.js

Lines changed: 54 additions & 53 deletions
Large diffs are not rendered by default.

src/utils/date.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const { Logger, LocaleManager } = require('./modules').ModuleStore;
22

33
export function convertToHMS(timeInSeconds) {
4-
timeInSeconds = Number(timeInSeconds);
5-
64
const hours = Math.floor(timeInSeconds / 3600);
75
const minutes = Math.floor((timeInSeconds % 3600) / 60);
86
const seconds = Math.floor((timeInSeconds % 3600) % 60);

src/utils/modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ const ChannelItemUtils = WebpackModules?.getModule(
8989
);
9090

9191
const ChannelItemUtilsKey = Object.keys(ChannelItemUtils || {}).find((k) => {
92-
return ChannelItemUtils[k]?.toString()?.includes('.AnnouncementsWarningIcon');
92+
return ChannelItemUtils[k]?.toString()?.includes(',textFocused:');
9393
});
9494

9595
const RolePill = WebpackModules?.getModule(

0 commit comments

Comments
 (0)