mirror of
https://gitcode.com/gh_mirrors/re/react-native-pushy.git
synced 2025-10-23 17:48:55 +08:00
add currentversioninfo
This commit is contained in:
@@ -171,27 +171,20 @@ export class UpdateModuleImpl {
|
||||
}
|
||||
}
|
||||
|
||||
static async setLocalHashInfo(
|
||||
static setLocalHashInfo(
|
||||
updateContext: UpdateContext,
|
||||
hash: string,
|
||||
info: string
|
||||
): Promise<boolean> {
|
||||
if (!this.checkJson(info)) {
|
||||
await updateContext.setKv(`hash_${hash}`, info);
|
||||
throw new Error('校验报错:json字符串格式错误');
|
||||
}
|
||||
await updateContext.setKv(`hash_${hash}`, info);
|
||||
): boolean {
|
||||
updateContext.setKv(`hash_${hash}`, info);
|
||||
return true;
|
||||
}
|
||||
|
||||
static async getLocalHashInfo(
|
||||
static getLocalHashInfo(
|
||||
updateContext: UpdateContext,
|
||||
hash: string
|
||||
): Promise<string> {
|
||||
const value = await updateContext.getKv(`hash_${hash}`);
|
||||
if (!this.checkJson(value)) {
|
||||
throw new Error('校验报错:json字符串格式错误');
|
||||
}
|
||||
): string {
|
||||
const value = updateContext.getKv(`hash_${hash}`);
|
||||
return value;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user