frontend: source: Fix conflicting block-scoped variable

This commit is contained in:
Danny Lin 2021-12-18 19:47:34 -08:00
parent 5813bd1b8e
commit 13e064bc56

View file

@ -186,11 +186,11 @@ class SourceResolver {
return await this.wrapLeafFile(imagesZip, factoryPath || src)
}
let factoryPath = (await fs.readdir(src))
let newFactoryPath = (await fs.readdir(src))
.find(f => f.startsWith(`${this.device}-${this.buildId}-factory-`))
if (factoryPath != undefined) {
if (newFactoryPath != undefined) {
// Factory images zip
return await this.wrapLeafFile(`${src}/${factoryPath}`, factoryPath)
return await this.wrapLeafFile(`${src}/${newFactoryPath}`, newFactoryPath)
}
}