mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-15 11:00:47 +02:00
Fix error banner not getting removed on correct upload (#3114)
This line: https://github.com/Stirling-Tools/Stirling-PDF/blob/9a0dad8bd7f2ae4333dab78d6313c5d95c4ac9b8/src/main/resources/static/js/DecryptFiles.js#L50 Appears to not relinquish flow control correctly and leads to `this.removeErrorBanner()` not getting called. Since the program still functions correctly I simply ensured that `removeErrorBanner()` is called before the `await` call to ensure that it works. Uploading a functioning pdf will now successfully remove the error banner. As to why the await call isn't functioning correctly I'm not sure, but the download appears to be working as it only seems to skip the error banner part. Closes #2419 --- ## Checklist ### General - [x] I have read the [Contribution Guidelines](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/CONTRIBUTING.md) - [x] I have read the [Stirling-PDF Developer Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md) (if applicable) - [x] I have read the [How to add new languages to Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md) (if applicable) - [x] I have performed a self-review of my own code - [x] My changes generate no new warnings ### Documentation - [x] I have updated relevant docs on [Stirling-PDF's doc repo](https://github.com/Stirling-Tools/Stirling-Tools.github.io/blob/main/docs/) (if functionality has heavily changed) - [x] I have read the section [Add New Translation Tags](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/HowToAddNewLanguage.md#add-new-translation-tags) (for new translation tags only) ### UI Changes (if applicable) - [x] Screenshots or videos demonstrating the UI changes are attached (e.g., as comments or direct attachments in the PR) ### Testing (if applicable) - [x] I have tested my changes locally. Refer to the [Testing Guide](https://github.com/Stirling-Tools/Stirling-PDF/blob/main/DeveloperGuide.md#6-testing) for more details.
This commit is contained in:
@@ -47,9 +47,11 @@ export class DecryptFile {
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const decryptedBlob = await response.blob();
|
||||
this.removeErrorBanner();
|
||||
return new File([decryptedBlob], file.name, {type: 'application/pdf'});
|
||||
const decryptedBlob = await response.blob();
|
||||
return new File([decryptedBlob], file.name, {
|
||||
type: "application/pdf",
|
||||
});
|
||||
} else {
|
||||
const errorText = await response.text();
|
||||
console.error(`${window.decrypt.invalidPassword} ${errorText}`);
|
||||
|
||||
Reference in New Issue
Block a user