mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-29 12:33:10 +08:00
use latest rnoh package
This commit is contained in:
@@ -23,6 +23,11 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
|
||||
}
|
||||
|
||||
async getBundle(): Promise<FileJSBundle> {
|
||||
if (!this.path) {
|
||||
throw new JSBundleProviderError({
|
||||
whatHappened: 'No pushy bundle found. using default bundle',
|
||||
})
|
||||
}
|
||||
try {
|
||||
const status = await fs.access(this.path, fs.OpenMode.READ_ONLY);
|
||||
if (status) {
|
||||
@@ -30,7 +35,6 @@ export class PushyFileJSBundleProvider extends JSBundleProvider {
|
||||
filePath: this.path
|
||||
}
|
||||
}
|
||||
throw new Error('Update bundle not found');
|
||||
} catch (error) {
|
||||
throw new JSBundleProviderError({
|
||||
whatHappened: `Couldn't load JSBundle from ${this.path}`,
|
||||
|
||||
@@ -189,18 +189,11 @@ export class UpdateContext {
|
||||
}
|
||||
}
|
||||
|
||||
public static getBundleUrl(
|
||||
context: common.UIAbilityContext,
|
||||
defaultAssetsUrl?: string,
|
||||
) {
|
||||
return new UpdateContext(context).getBundleUrl(defaultAssetsUrl);
|
||||
}
|
||||
|
||||
public getBundleUrl(defaultAssetsUrl?: string) {
|
||||
public getBundleUrl() {
|
||||
UpdateContext.isUsingBundleUrl = true;
|
||||
const currentVersion = this.getCurrentVersion();
|
||||
if (!currentVersion) {
|
||||
return defaultAssetsUrl;
|
||||
return '';
|
||||
}
|
||||
if (!this.isFirstTime()) {
|
||||
if (!this.preferences.getSync('firstTimeOk', true)) {
|
||||
@@ -222,7 +215,7 @@ export class UpdateContext {
|
||||
version = this.rollBack();
|
||||
}
|
||||
}
|
||||
return defaultAssetsUrl;
|
||||
return '';
|
||||
}
|
||||
|
||||
getPackageVersion(): string {
|
||||
|
||||
Reference in New Issue
Block a user