mirror of
https://github.com/OpenFusionProject/Client.git
synced 2024-11-17 03:20:06 +00:00
fixed hash check timing on config change
This commit is contained in:
parent
4105472d3c
commit
01a4318db5
@ -302,17 +302,17 @@ function editConfig() {
|
|||||||
jsonToModify["verify-offline-cache"] = $("#editconfig-verifyofflinecache").prop("checked");
|
jsonToModify["verify-offline-cache"] = $("#editconfig-verifyofflinecache").prop("checked");
|
||||||
|
|
||||||
var dirInput = $("#editconfig-offlinecachelocation:text").val();
|
var dirInput = $("#editconfig-offlinecachelocation:text").val();
|
||||||
|
var shouldChangeRoot = (
|
||||||
jsonToModify["offline-cache-location"] = (
|
|
||||||
remotefs.existsSync(dirInput) &&
|
remotefs.existsSync(dirInput) &&
|
||||||
remotefs.statSync(dirInput).isDirectory()
|
remotefs.statSync(dirInput).isDirectory()
|
||||||
) ? dirInput : offlineRoot;
|
);
|
||||||
|
|
||||||
|
jsonToModify["offline-cache-location"] = shouldChangeRoot ? dirInput : offlineRoot;
|
||||||
|
|
||||||
remotefs.writeFileSync(configPath, JSON.stringify(jsonToModify, null, 4));
|
remotefs.writeFileSync(configPath, JSON.stringify(jsonToModify, null, 4));
|
||||||
|
|
||||||
if (jsonToModify["offline-cache-location"] !== offlineRoot)
|
|
||||||
handleCache("hash-check");
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
if (shouldChangeRoot) handleCache("hash-check");
|
||||||
}
|
}
|
||||||
|
|
||||||
function validateCacheLocation() {
|
function validateCacheLocation() {
|
||||||
|
Loading…
Reference in New Issue
Block a user