ShowHiddenChannels: Fix re-organizing channels (#2942)

This commit is contained in:
sadan4 2024-10-10 08:14:52 -04:00 committed by Nuckyz
parent 2dce060cf9
commit aa1b446c07
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9

View file

@ -61,6 +61,10 @@ export const settings = definePluginSettings({
}
});
function isUncategorized(objChannel: { channel: Channel; comparator: number; }) {
return objChannel.channel.id === "null" && objChannel.channel.name === "Uncategorized" && objChannel.comparator === -1;
}
export default definePlugin({
name: "ShowHiddenChannels",
description: "Show channels that you do not have access to view.",
@ -503,7 +507,7 @@ export default definePlugin({
res[key] ??= [];
for (const objChannel of maybeObjChannels) {
if (objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel);
if (isUncategorized(objChannel) || objChannel.channel.id === null || !this.isHiddenChannel(objChannel.channel)) res[key].push(objChannel);
}
}