Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Fixed issue where archive size wouldn't update #13507

Closed
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -43,7 +43,7 @@ public override async Task ExecuteAsync()
SplittingSize = dialog.SplittingSize,
};

await ArchiveHelpers.CompressArchiveAsync(creator);
await ArchiveHelpers.CompressArchiveAsync(creator, context.ShellPage);
}
}
}
Expand Up @@ -26,8 +26,7 @@ public override Task ExecuteAsync()
FileName = fileName,
FileFormat = ArchiveFormats.SevenZip,
};

return ArchiveHelpers.CompressArchiveAsync(creator);
return ArchiveHelpers.CompressArchiveAsync(creator, context.ShellPage);
}
}
}
Expand Up @@ -26,8 +26,7 @@ public override Task ExecuteAsync()
FileName = fileName,
FileFormat = ArchiveFormats.Zip,
};

return ArchiveHelpers.CompressArchiveAsync(creator);
return ArchiveHelpers.CompressArchiveAsync(creator, context.ShellPage);
}
}
}
4 changes: 3 additions & 1 deletion src/Files.App/Utils/Archives/ArchiveHelpers.cs
@@ -1,6 +1,7 @@
// Copyright (c) 2023 Files Community
// Licensed under the MIT License. See the LICENSE.

using Files.App.Actions;
using Files.App.Dialogs;
using Files.App.ViewModels.Dialogs;
using Files.Shared.Helpers;
Expand Down Expand Up @@ -59,7 +60,7 @@ public static (string[] Sources, string directory, string fileName) GetCompressD
return (sources, directory, fileName);
}

public static async Task CompressArchiveAsync(IArchiveCreator creator)
public static async Task CompressArchiveAsync(IArchiveCreator creator, IShellPage associated)
{
var archivePath = creator.GetArchivePath();

Expand Down Expand Up @@ -108,6 +109,7 @@ public static async Task CompressArchiveAsync(IArchiveCreator creator)
FileOperationType.Compressed
);
}
await associated.Refresh_Click();
Copy link
Member

@yaira2 yaira2 Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to only update the individual item? Ideally this would be done from the file watcher but I don't think we need to resort to refreshing the tab.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yaira2 I would like to give a shot at fixing this issue, and continue from where Mohammed brought it. Could you point me to where the file watcher code is in this repo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheChilledBuffalo thank you for reaching out, the file watcher code is in ItemViewModel.cs.

}

private static async Task ExtractArchive(BaseStorageFile archive, BaseStorageFolder? destinationFolder, string password)
Expand Down