Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function transition(increment = 1) {
const newIndex = index + increment;
if (newIndex >= content.children.length
|| newIndex >= sections.children.length
|| newIndex < 0) {
await ipc.callMain('closeIntroWindow');
return;
}
index += increment;
// Change the button to show "Finish" instead of "Next"
if (index === content.children.length - 1) {
button.textContent = 'Finish';
} else {
button.textContent = 'Next';
}
if (index > 0) {
back.classList.add('active');
} else {
back.classList.remove('active');
const initApi = async seedPhrase => {
let url = config.get('marketmakerUrl');
if (url) {
console.log('Using custom marketmaker URL:', url);
} else {
const port = await ipc.callMain('start-marketmaker', seedPhrase);
url = `http://127.0.0.1:${port}`;
}
return new Api({
endpoint: url,
rpcPassword: await sha256(seedPhrase),
concurrency: 10,
});
};
async openPlayer ({ row }) {
let recordLog = row.getModel()
recordLog.setStatus(RecordLogStatus.ReadyToPlay, true)
await ipc.callMain(IPCMsg.CreatePlayer, recordLog.file)
recordLog.setStatus(RecordLogStatus.ReadyToPlay, false)
},
openSaveFolder ({ row }) {
async save () {
await ipc.callMain(IPCMsg.SetConfig, this.$data)
}
}
async init () {
let data = await ipc.callMain(IPCMsg.GetConfig)
this.setData(data)
ipc.answerMain(IPCMsg.SetConfig, this.setData)
},
async setData (data) {
async stopMarketmaker() {
await this.api.stop();
await ipc.callMain('stop-marketmaker');
}
}
async function openPath(dataPath) {
spinner.classList.add('active');
await ipc.callMain('openProject', dataPath);
}
footer.addEventListener('click', async () => {
spinner.classList.add('active');
const res = await ipc.callMain('openProject');
if (!res) spinner.classList.remove('active');
});
public async showOpenDialogImage(): Promise {
track('dialog', 'open-file', 'onion');
return await ipc.callMain('show-open-dialog-image');
}