Skip to content

Commit

Permalink
0.1.4-1.1.1: Fixed invalid unpack config in package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
asivery committed Apr 26, 2022
1 parent 43f91a4 commit dfd8a41
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
6 changes: 4 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electronwmd",
"version": "0.1.3-1.1.1",
"version": "0.1.4-1.1.1",
"description": "Electron version of WebMinidisc Pro",
"main": "dist/main.js",
"scripts": {
Expand All @@ -21,7 +21,8 @@
"asarUnpack": [
"./node_modules/netmd-js/**/*",
"./node_modules/crypto-js/**/*",
"./node_modules/jconv/**/*"
"./node_modules/jconv/**/*",
"./node_modules/jsbi/**/*"
],
"win": {
"icon": "./res/icon.ico"
Expand All @@ -42,6 +43,7 @@
"@types/electron": "^1.6.10",
"async-mutex": "^0.3.2",
"jconv": "^0.1.5",
"jsbi": "^3.2.5",
"netmd-js": "^3.2.3",
"typescript": "^4.3.5",
"webusb": "^2.2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function integrate(window: BrowserWindow){
writable: false,
value: { usb }
});
usb.ondisconnect = () => window.reload();
const service = new NetMDUSBService({debug: true});

let currentObj = service as any;
Expand All @@ -43,10 +44,9 @@ async function integrate(window: BrowserWindow){
}
}
try{
return await (service as any)[n](...allArgs);
return [ await (service as any)[n](...allArgs), null ];
}catch(err){
window.reload();
return null;
return [ null, err ];
}
})
});
Expand Down
6 changes: 4 additions & 2 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
ipcRenderer.on("_callback", (evt, cbname, ...args) => callbacks[cbname](...args));

for(const name of defined){
iface[name] = (...args: any[]) => {
iface[name] = async (...args: any[]) => {
const registeredForThis = new Set<string>();
for(let i = 0; i<args.length; i++){
if(typeof args[i] === "function"){
Expand All @@ -25,7 +25,9 @@ import {
args[i] = { interprocessType: "function" };
}
}
return ipcRenderer.invoke(name, ...args);
const [ response, error ] = await ipcRenderer.invoke(name, ...args);
if(error) throw error;
return await response;
}
console.log(`Registering invoker for #${i++}(${name})`);
}
Expand Down
4 changes: 2 additions & 2 deletions src/wmd/netmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ export class NetMDUSBService implements NetMDService {
@asyncMutex
async deleteTracks(indexes: number[]) {
try{
this.netmdInterface!.stop();
await this.netmdInterface!.stop();
}catch(ex){}
indexes = indexes.sort();
indexes.reverse();
Expand All @@ -277,7 +277,7 @@ export class NetMDUSBService implements NetMDService {
@asyncMutex
async wipeDisc() {
try{
this.netmdInterface!.stop();
await this.netmdInterface!.stop();
}catch(ex){}
await this.netmdInterface!.eraseDisc();
this.dropCachedContentList();
Expand Down

0 comments on commit dfd8a41

Please sign in to comment.