Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

updated #231

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ private void jsInit(CallbackContext callback) {
handler.post(new Runnable() {
@Override
public void run() {
webView.clearHistory();
// Let me do clearHistory myself when homepage loaded.
//webView.clearHistory();

}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import com.nordnetab.chcp.main.config.ApplicationConfig;
import com.nordnetab.chcp.main.config.ContentManifest;
import com.nordnetab.chcp.main.events.NothingToInstallEvent;
import com.nordnetab.chcp.main.events.UpdateInstallationErrorEvent;
import com.nordnetab.chcp.main.events.UpdateInstalledEvent;
import com.nordnetab.chcp.main.events.WorkerEvent;
Expand Down Expand Up @@ -74,7 +73,7 @@ public void run() {
deleteUnusedFiles();

// install the update
boolean isInstalled = moveFilesFromInstallationFolderToWwwFodler();
boolean isInstalled = moveFilesFromInstallationFolderToWwwFolder();
if (!isInstalled) {
cleanUpOnFailure();
setResultForError(ChcpError.FAILED_TO_COPY_NEW_CONTENT_FILES);
Expand Down Expand Up @@ -130,8 +129,11 @@ private boolean init() {
*/
private boolean copyFilesFromCurrentReleaseToNewRelease() {
boolean result = true;
// Happens in some weird cases
if(currentReleaseFS.getWwwFolder().equals(newReleaseFS.getWwwFolder())) return result;
final File currentWwwFolder = new File(currentReleaseFS.getWwwFolder());
final File newWwwFolder = new File(newReleaseFS.getWwwFolder());

try {
// just in case if www folder already exists - remove it
if (newWwwFolder.exists()) {
Expand Down Expand Up @@ -177,7 +179,7 @@ private void deleteUnusedFiles() {
*
* @return <code>true</code> if files are copied; <code>false</code> - otherwise
*/
private boolean moveFilesFromInstallationFolderToWwwFodler() {
private boolean moveFilesFromInstallationFolderToWwwFolder() {
try {
FilesUtility.copy(newReleaseFS.getDownloadFolder(), newReleaseFS.getWwwFolder());

Expand Down
2 changes: 1 addition & 1 deletion src/ios/Updater/HCPInstallationWorker.m
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ - (BOOL)isUpdateValid:(NSError **)error {

- (BOOL)copyFilesFromCurrentReleaseToNewRelease:(NSError **)error {
*error = nil;

if ([_newReleaseFS.wwwFolder.path isEqualToString: _currentReleaseFS.wwwFolder.path]) return YES;
// just in case check if previous www folder exists; if it does - remove it before copying new stuff
if ([_fileManager fileExistsAtPath:_newReleaseFS.wwwFolder.path]) {
[_fileManager removeItemAtURL:_newReleaseFS.wwwFolder error:nil];
Expand Down