removed channel type (#170)

Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
Snek 2022-10-30 19:17:46 +01:00 committed by GitHub
parent a43a41f61f
commit b905743077
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
import { Flex } from "../components/Flex"; import { Flex } from "../components/Flex";
import { Devs } from "../utils/constants"; import { Devs } from "../utils/constants";
import { ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "../utils/modal"; import { ModalContent, ModalFooter, ModalHeader, ModalRoot, ModalSize, openModal } from "../utils/modal";
@ -74,7 +75,7 @@ export default definePlugin({
find: ".handleThreadsPopoutClose();", find: ".handleThreadsPopoutClose();",
replacement: { replacement: {
match: /((\w)\.handleThreadsPopoutClose\(\);)/g, match: /((\w)\.handleThreadsPopoutClose\(\);)/g,
replace: "if(Vencord.Plugins.plugins.ShowHiddenChannels.channelSelected($2?.props?.channel))return;$1" replace: "if(arguments[0].button===0&&Vencord.Plugins.plugins.ShowHiddenChannels.channelSelected($2?.props?.channel))return;$1"
} }
}, },
{ {
@ -127,7 +128,6 @@ export default definePlugin({
// check for type again, otherwise it would show it for hidden stage channels // check for type again, otherwise it would show it for hidden stage channels
if (channel.type === 0 && isHidden) { if (channel.type === 0 && isHidden) {
const lastMessageDate = channel.lastActiveTimestamp ? new Date(channel.lastActiveTimestamp).toLocaleString() : null; const lastMessageDate = channel.lastActiveTimestamp ? new Date(channel.lastActiveTimestamp).toLocaleString() : null;
openModal(modalProps => ( openModal(modalProps => (
<ModalRoot size={ModalSize.SMALL} {...modalProps}> <ModalRoot size={ModalSize.SMALL} {...modalProps}>
<ModalHeader> <ModalHeader>
@ -166,7 +166,7 @@ export default definePlugin({
size={Button.Sizes.SMALL} size={Button.Sizes.SMALL}
color={Button.Colors.PRIMARY} color={Button.Colors.PRIMARY}
> >
Continue Close
</Button> </Button>
</Flex> </Flex>
</ModalFooter> </ModalFooter>