Skip to content

Commit

Permalink
use downloadURL, don't format src/public for bundle diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 20, 2024
1 parent ce06085 commit f220631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"dev": "npm run asc && webpack-dev-server --hot",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"format": "prettier src/**/*.{js,ts} --write",
"format": "prettier src/js/**/*.{js,ts} --write",
"prepare": "husky install",
"test": "npm run asc && jest",
"asc": "asc --target release --optimizeLevel 3 --converge",
Expand Down
8 changes: 2 additions & 6 deletions src/js/jagex2/io/ClientWorkerStream.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import LinkList from '../datastruct/LinkList';
import Linkable from '../datastruct/Linkable';
import {sleep} from '../util/JsUtil';
import {downloadURL} from '../util/SaveUtil';

export default class ClientWorkerStream {
// constructor
Expand Down Expand Up @@ -156,12 +157,7 @@ class WorkerReader {
private onmessage = (e: MessageEvent): void => {
switch (e.data.type) {
case 'save': {
const a: HTMLAnchorElement = document.createElement('a');
a.href = e.data.value;
a.download = e.data.path.split('/').pop();
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
downloadURL(e.data.value, e.data.path.split('/').pop().split('\\').pop());
URL.revokeObjectURL(e.data.value);
break;
}
Expand Down

0 comments on commit f220631

Please sign in to comment.