Skip to content

Commit

Permalink
Merge pull request #673 from lovegaoshi/dev
Browse files Browse the repository at this point in the history
chore: disable newarch
  • Loading branch information
lovegaoshi authored Dec 3, 2024
2 parents d79a63b + c7e45dd commit 7547259
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=true
newArchEnabled=false

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
16 changes: 10 additions & 6 deletions src/utils/mediafetch/ytbi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { decode, encode } from 'base-64';
import { Innertube, ClientType } from 'youtubei.js';
import { getSecure as getItem } from '@utils/ChromeStorageAPI';

import { timeFunction } from '../Utils';
import MMKV from '../fakeMMKV';
import { StorageKeys } from '@enums/Storage';
import logger from '../Logger';
Expand Down Expand Up @@ -44,12 +45,8 @@ global.CustomEvent = CustomEvent as any;

let ytClient: undefined | Innertube;

export default async () => {
if (ytClient !== undefined) {
return ytClient;
}
logger.debug('[ytbi.js] ytClient is initializing. takes time...');
ytClient = await getItem(StorageKeys.YTMCOOKIES, undefined).then(cookie =>
const createYtClient = () =>
getItem(StorageKeys.YTMCOOKIES, undefined).then(cookie =>
Innertube.create({
retrieve_player: true,
enable_session_cache: false,
Expand All @@ -58,6 +55,13 @@ export default async () => {
cookie,
}),
);

export default async () => {
if (ytClient !== undefined) {
return ytClient;
}
logger.debug('[ytbi.js] ytClient is initializing. takes time...');
ytClient = (await timeFunction(createYtClient, 'ytClient init')).result;
return ytClient!;
};

Expand Down

0 comments on commit 7547259

Please sign in to comment.