Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions app/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,17 @@ function createWindow() {
}

ipcMain.handle('show-notification', (_event, title, body) => {
new ENotification({
const notification = new ENotification({
title,
body,
icon
}).show();
});

notification.on('click', () => {
mainWindow?.show();
});

notification.show();
});

ipcMain.handle('verify-address', (_event, wallets, address) => {
Expand Down
2 changes: 1 addition & 1 deletion installers/windows/Branta.Wix/Package.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="Branta"
Manufacturer="Branta LLC"
Version="0.10.1"
Version="0.10.2"
UpgradeCode="4df52912-9d80-4a14-b98b-33a114a4f5ac">
<MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" />

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "branta",
"productName": "Branta",
"version": "0.10.1",
"version": "0.10.2",
"main": "build/app/main.js",
"author": "Branta LLC",
"description": "Verify your bitcoin payments.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,45 @@ export class ClipboardDetailsComponent extends BaseClipboardComponent {

onVerify(): void {
(async () => {
var result = await this.queryPayments(this.clipboardItem?.value ?? "")
const value = this.clipboardItem?.value;

if (!value) {
return;
}

const result = await this.queryPayments(value);

if (result) {
this.clipboardItemChange.emit(result as PaymentClipboardItem);
} else {
this.toastrService.error(`Payment not found.`);
return;
}

this.showPaymentNotFoundToast(value);
})();
}

private showPaymentNotFoundToast(value: string): void {
this.toastrService.error(
`For more info on why this payment was not found click <a href="#" class="payment-link">here</a>.`,
'Payment not found',
{
enableHtml: true,
tapToDismiss: false
}
);

setTimeout(() => {
const link = document.querySelector('.toast-error .payment-link');
if (link) {
link.addEventListener('click', (e) => {
e.preventDefault();
const url = `${this.serverService.baseUrl}/v2/verify/${encodeURIComponent(value)}`;
window.electron.openUrl(url);
});
}
}, 100);
}

private async queryPayments(value: string): Promise<PaymentClipboardItem | null> {
try {
const paymentClipboardItems = await lastValueFrom(this.serverService.getPayment(value));
Expand Down
4 changes: 4 additions & 0 deletions src/app/features/settings/settings.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export class SettingsComponent {
developerMode: new FormControl(settings.developerMode)
});

this.formGroup.valueChanges.subscribe((settings) => {
this.settingsService.save(settings);
});

this.formGroup.get('developerMode')?.valueChanges.subscribe(() => {
this.clipboardService.rerunGetClipboardItem();
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/services/server.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ServerService {
return this.httpClient.get<PaymentClipboardItem[]>(`${this.baseUrl}/v2/payments/${encodeURIComponent(value)}`);
}

private get baseUrl(): string {
get baseUrl(): string {
if (environment.production == false) {
return 'http://localhost:3000';
}
Expand Down
Loading