(autoSave: boolean = false)
| 74 | private _fetchInstalledResolves: CallbackFn[] = [] |
| 75 | |
| 76 | resetCurrentVersion(autoSave: boolean = false) { |
| 77 | if (this.typeFlag !== 'php' && this.installed.length > 0) { |
| 78 | const appStore = AppStore() |
| 79 | const server = appStore.serverCurrent(this.typeFlag) |
| 80 | const currentVersion = server?.current?.version |
| 81 | const currentPath = server?.current?.path |
| 82 | const findCurrent = |
| 83 | currentVersion && |
| 84 | currentPath && |
| 85 | this.installed.find( |
| 86 | (d) => d.version && d.enable && d.version === currentVersion && d.path === currentPath |
| 87 | ) |
| 88 | if (!findCurrent) { |
| 89 | const find = this.installed.find((d) => d.version && d.enable) |
| 90 | if (find) { |
| 91 | appStore.UPDATE_SERVER_CURRENT({ |
| 92 | flag: this.typeFlag, |
| 93 | data: JSON.parse(JSON.stringify(find)) |
| 94 | }) |
| 95 | if (autoSave) { |
| 96 | appStore.saveConfig().catch() |
| 97 | } |
| 98 | return true |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | return false |
| 104 | } |
| 105 | |
| 106 | async applyInstalledVersions(installed: SoftInstalled[]) { |
| 107 | const appStore = AppStore() |
no test coverage detected