From ddeba803754f0a83119043872a7ceac01960b882 Mon Sep 17 00:00:00 2001 From: fres621 <126067139+fres621@users.noreply.github.com> Date: Sat, 11 May 2024 07:26:25 +0100 Subject: [PATCH] Use i18n instead of findByProps this improves performance a bit --- plugins/FileContentPreview/patches/RowManager.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/FileContentPreview/patches/RowManager.ts b/plugins/FileContentPreview/patches/RowManager.ts index 9e9cd1e..218c0b2 100644 --- a/plugins/FileContentPreview/patches/RowManager.ts +++ b/plugins/FileContentPreview/patches/RowManager.ts @@ -2,12 +2,11 @@ import { findByProps, findByName } from "@vendetta/metro"; import { after, before } from "@vendetta/patcher"; import translations from "../translations"; import filetypes from "../filetypes"; -import { ReactNative } from "@vendetta/metro/common"; +import { ReactNative, i18n } from "@vendetta/metro/common"; const RowManager = findByName("RowManager"); const Locale = findByProps("Messages"); -const loc = findByProps("getLocale"); function makeRPL(filename = "unknown", size = "? bytes") { return { borderColor: -251658241, @@ -20,7 +19,7 @@ function makeRPL(filename = "unknown", size = "? bytes") { type: null, extendedType: 4, participantAvatarUris: [], - acceptLabelText: translations.PREVIEW[loc.getLocale()] ?? "Preview", + acceptLabelText: translations.PREVIEW[i18n.getLocale()] ?? "Preview", noParticipantsText: '\n' + filename, ctaEnabled: true } };