give a name to the proxy dummy function, for better logs in the console

This commit is contained in:
Nuckyz 2024-05-07 02:57:17 -03:00
parent b047f9ce28
commit 6e0064c5fc
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
2 changed files with 2 additions and 2 deletions

View file

@ -65,7 +65,7 @@ export function proxyLazy<T = any>(factory: () => T, attempts = 5, isChild = fal
let isSameTick = true; let isSameTick = true;
if (!isChild) setTimeout(() => isSameTick = false, 0); if (!isChild) setTimeout(() => isSameTick = false, 0);
const proxyDummy = Object.assign(function () { }, { const proxyDummy = Object.assign(function ProxyDummy() { }, {
[proxyLazyGet]() { [proxyLazyGet]() {
if (!proxyDummy[proxyLazyCache]) { if (!proxyDummy[proxyLazyCache]) {
if (!get.$$vencordLazyFailed()) { if (!get.$$vencordLazyFailed()) {

View file

@ -47,7 +47,7 @@ export function proxyInner<T = any>(
let isSameTick = true; let isSameTick = true;
if (!isChild) setTimeout(() => isSameTick = false, 0); if (!isChild) setTimeout(() => isSameTick = false, 0);
const proxyDummy = Object.assign(function () { }, { const proxyDummy = Object.assign(function ProxyDummy() { }, {
[proxyInnerGet]: function () { [proxyInnerGet]: function () {
if (proxyDummy[proxyInnerValue] == null) { if (proxyDummy[proxyInnerValue] == null) {
throw new Error(errMsg); throw new Error(errMsg);