Skip to content

Commit

Permalink
fix: stop using Zeres lib to get LocaleManager module (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustOptimize authored Nov 7, 2024
1 parent 3b3c284 commit 434c259
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
24 changes: 12 additions & 12 deletions ShowHiddenChannels.plugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @name ShowHiddenChannels
* @displayName Show Hidden Channels (SHC)
* @version 0.5.5
* @version 0.5.6
* @author JustOptimize (Oggetto)
* @authorId 619203349954166804
* @source https://github.com/JustOptimize/ShowHiddenChannels
Expand Down Expand Up @@ -580,7 +580,6 @@ const {
ReactDOM,
GuildChannelsStore,
GuildMemberStore,
LocaleManager,
NavigationUtils,
ImageResolver,
UserStore,
Expand All @@ -598,6 +597,7 @@ const Utils = window.BdApi?.Utils;
const BetterWebpackModules = window.BdApi.Webpack;

const GuildStore = WebpackModules?.getByProps('getGuild', 'getGuildCount', 'getGuildIds', 'getGuilds', 'isLoaded');
const LocaleManager = WebpackModules?.getByProps('setLocale');

const DiscordConstants = {};

Expand Down Expand Up @@ -661,11 +661,11 @@ if (!ChannelPermissionStore?.can) {

const PermissionStoreActionHandler = Utils?.findInTree(
Dispatcher,
(c) => c?.name == 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
(c) => c?.name === 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
)?.actionHandler;
const ChannelListStoreActionHandler = Utils?.findInTree(
Dispatcher,
(c) => c?.name == 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
(c) => c?.name === 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
)?.actionHandler;

const container = WebpackModules?.getByProps('container', 'hubContainer')?.container;
Expand Down Expand Up @@ -799,7 +799,7 @@ function checkVariables() {

for (const variable in UsedModules) {
if (!UsedModules[variable]) {
Logger.err('Variable not found: ' + variable);
Logger.err(`Variable not found: ${variable}`);
}
}

Expand Down Expand Up @@ -901,11 +901,17 @@ const config = {
],
description:
"A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible).",
version: "0.5.5",
version: "0.5.6",
github: 'https://github.com/JustOptimize/ShowHiddenChannels',
},

changelog: [
{
title: 'v0.5.6 - Fix Missing Module (LocaleManager)',
items: [
'Fixed missing LocaleManager module.',
],
},
{
title: 'v0.5.5 - Fix Crash',
items: [
Expand All @@ -918,12 +924,6 @@ const config = {
'Fix Crash when muting/unmuting specific servers. (#214)',
],
},
{
title: 'v0.5.3 - Module Fix',
items: [
'Removed deprecated rolePill module.',
],
},
],

main: 'ShowHiddenChannels.plugin.js',
Expand Down
14 changes: 7 additions & 7 deletions src/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "ShowHiddenChannels",
"displayName": "Show Hidden Channels (SHC)",
"version": "0.5.5",
"author": "JustOptimize (Oggetto)",
"authorId": "619203349954166804",
"source": "https://github.com/JustOptimize/ShowHiddenChannels",
"description": "A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible)."
"name": "ShowHiddenChannels",
"displayName": "Show Hidden Channels (SHC)",
"version": "0.5.6",
"author": "JustOptimize (Oggetto)",
"authorId": "619203349954166804",
"source": "https://github.com/JustOptimize/ShowHiddenChannels",
"description": "A plugin which displays all hidden Channels and allows users to view information about them, this won't allow you to read them (impossible)."
}
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ const config = {
},

changelog: [
{
title: 'v0.5.6 - Fix Missing Module',
items: [
'Fixed missing LocaleManager module.',
],
},
{
title: 'v0.5.5 - Fix Crash',
items: [
Expand All @@ -27,12 +33,6 @@ const config = {
'Fix Crash when muting/unmuting specific servers. (#214)',
],
},
{
title: 'v0.5.3 - Module Fix',
items: [
'Removed deprecated rolePill module.',
],
},
],

main: 'ShowHiddenChannels.plugin.js',
Expand Down
8 changes: 4 additions & 4 deletions src/utils/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const {
ReactDOM,
GuildChannelsStore,
GuildMemberStore,
LocaleManager,
NavigationUtils,
ImageResolver,
UserStore,
Expand All @@ -44,6 +43,7 @@ const Utils = window.BdApi?.Utils;
const BetterWebpackModules = window.BdApi.Webpack;

const GuildStore = WebpackModules?.getByProps('getGuild', 'getGuildCount', 'getGuildIds', 'getGuilds', 'isLoaded');
const LocaleManager = WebpackModules?.getByProps('setLocale');

const DiscordConstants = {};

Expand Down Expand Up @@ -107,11 +107,11 @@ if (!ChannelPermissionStore?.can) {

const PermissionStoreActionHandler = Utils?.findInTree(
Dispatcher,
(c) => c?.name == 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
(c) => c?.name === 'PermissionStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
)?.actionHandler;
const ChannelListStoreActionHandler = Utils?.findInTree(
Dispatcher,
(c) => c?.name == 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
(c) => c?.name === 'ChannelListStore' && typeof c?.actionHandler?.CONNECTION_OPEN === 'function'
)?.actionHandler;

const container = WebpackModules?.getByProps('container', 'hubContainer')?.container;
Expand Down Expand Up @@ -245,7 +245,7 @@ function checkVariables() {

for (const variable in UsedModules) {
if (!UsedModules[variable]) {
Logger.err('Variable not found: ' + variable);
Logger.err(`Variable not found: ${variable}`);
}
}

Expand Down

0 comments on commit 434c259

Please sign in to comment.