diff --git a/vripper-server/src/main/java/tn/mnlr/vripper/services/AppSettingsService.java b/vripper-server/src/main/java/tn/mnlr/vripper/services/AppSettingsService.java index 4f728a1..7ab98f1 100644 --- a/vripper-server/src/main/java/tn/mnlr/vripper/services/AppSettingsService.java +++ b/vripper-server/src/main/java/tn/mnlr/vripper/services/AppSettingsService.java @@ -139,11 +139,6 @@ public class AppSettingsService { settings.setViewPhotos(false); } - if (settings.getNotification() == null) { - settings.setNotification(false); - } - - save(); } @@ -237,8 +232,6 @@ public class AppSettingsService { private Boolean clearCompleted; @JsonProperty("viewPhotos") private Boolean viewPhotos; - @JsonProperty("notification") - private Boolean notification; @JsonProperty("darkTheme") private Boolean darkTheme; diff --git a/vripper-ui/src/app/clipboard.service.ts b/vripper-ui/src/app/clipboard.service.ts index b08bc40..3d9053c 100644 --- a/vripper-ui/src/app/clipboard.service.ts +++ b/vripper-ui/src/app/clipboard.service.ts @@ -38,7 +38,7 @@ export class ClipboardService { _init(settings: Settings) { if (!this.electronService.isElectronApp) { - console.log('Clipboard deactive, not an electron app'); + console.log('Clipboard deactivated, not an electron app'); return; } if (this.interval != null) { diff --git a/vripper-ui/src/app/domain/settings.model.ts b/vripper-ui/src/app/domain/settings.model.ts index 18a202b..8a2a409 100644 --- a/vripper-ui/src/app/domain/settings.model.ts +++ b/vripper-ui/src/app/domain/settings.model.ts @@ -9,6 +9,5 @@ export interface Settings { vThanks: boolean; desktopClipboard: boolean; viewPhotos: boolean; - notification: boolean; resolveTitle: boolean; } diff --git a/vripper-ui/src/app/grab-queue/grab-queue.component.ts b/vripper-ui/src/app/grab-queue/grab-queue.component.ts index 191ed89..b588a35 100644 --- a/vripper-ui/src/app/grab-queue/grab-queue.component.ts +++ b/vripper-ui/src/app/grab-queue/grab-queue.component.ts @@ -1,10 +1,9 @@ -import {LinkCollectorService} from './../link-collector.service'; +import {LinkCollectorService} from '../link-collector.service'; import {UrlGrabRendererComponent} from './renderer/url-renderer.component'; import {GrabQueueDataSource} from './grab-queue.datasource'; import {ChangeDetectionStrategy, Component, NgZone, OnInit} from '@angular/core'; import {GridOptions} from 'ag-grid-community'; import {WsConnectionService} from '../ws-connection.service'; -import {NotificationService} from '../notification.service'; @Component({ selector: 'app-grab-queue', @@ -16,8 +15,7 @@ export class GrabQueueComponent implements OnInit { constructor( private wsConnection: WsConnectionService, private zone: NgZone, - private linkCollectorService: LinkCollectorService, - private notificationService: NotificationService) { + private linkCollectorService: LinkCollectorService) { this.gridOptions = { columnDefs: [ { @@ -40,7 +38,7 @@ export class GrabQueueComponent implements OnInit { getRowNodeId: data => data['threadId'], onGridReady: () => { this.gridOptions.api.sizeColumnsToFit(); - this.dataSource = new GrabQueueDataSource(this.wsConnection, this.gridOptions, this.zone, this.notificationService); + this.dataSource = new GrabQueueDataSource(this.wsConnection, this.gridOptions, this.zone); this.dataSource.connect(); }, onGridSizeChanged: () => this.gridOptions.api.sizeColumnsToFit(), diff --git a/vripper-ui/src/app/grab-queue/grab-queue.datasource.ts b/vripper-ui/src/app/grab-queue/grab-queue.datasource.ts index 1eda10d..cb59a8c 100644 --- a/vripper-ui/src/app/grab-queue/grab-queue.datasource.ts +++ b/vripper-ui/src/app/grab-queue/grab-queue.datasource.ts @@ -1,7 +1,6 @@ import {GrabQueueState} from '../domain/grab-queue.model'; import {Subscription} from 'rxjs'; import {WsConnectionService} from '../ws-connection.service'; -import {NotificationService} from '../notification.service'; import {GridOptions, RowNode} from 'ag-grid-community'; import {NgZone} from '@angular/core'; @@ -9,8 +8,7 @@ export class GrabQueueDataSource { constructor( private ws: WsConnectionService, private gridOptions: GridOptions, - private zone: NgZone, - private notificationService: NotificationService + private zone: NgZone ) { } @@ -30,13 +28,6 @@ export class GrabQueueDataSource { } }); this.gridOptions.api.applyTransaction({update: toUpdate, add: toAdd}); - const count = this.gridOptions.api.getDisplayedRowCount(); - if (count > 0 && toAdd.length > 0) { - this.notificationService.notifyFromGrabQueue( - 'Link Collector', - `You have ${count} ${count > 1 ? 'threads' : 'thread'} waiting in the link collector` - ); - } }); })); diff --git a/vripper-ui/src/app/notification.service.ts b/vripper-ui/src/app/notification.service.ts deleted file mode 100644 index 826d44b..0000000 --- a/vripper-ui/src/app/notification.service.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Injectable } from '@angular/core'; -import { AppService } from './app.service'; - -@Injectable({ - providedIn: 'root' -}) -export class NotificationService { - constructor(private appService: AppService) {} - - notifyFromGrabQueue(title: string, body: string) { - if (!this.appService.settings.notification) { - return; - } - if (!('Notification' in window)) { - return; - } else if (Notification.permission === 'granted') { - const notification = new Notification(title, { body: body, icon: 'assets/icon.png' }); - } else if (Notification.permission !== 'denied') { - Notification.requestPermission().then(function(permission) { - if (permission === 'granted') { - const notification = new Notification(title, { body: body, icon: 'assets/icon.png' }); - } - }); - } - } -} diff --git a/vripper-ui/src/app/settings/settings.component.html b/vripper-ui/src/app/settings/settings.component.html index eee7eb7..31a247c 100644 --- a/vripper-ui/src/app/settings/settings.component.html +++ b/vripper-ui/src/app/settings/settings.component.html @@ -110,11 +110,6 @@ >Monitor Clipboard - - Enable system notifications - diff --git a/vripper-ui/src/app/settings/settings.component.ts b/vripper-ui/src/app/settings/settings.component.ts index c2caf01..9c48e4b 100644 --- a/vripper-ui/src/app/settings/settings.component.ts +++ b/vripper-ui/src/app/settings/settings.component.ts @@ -46,8 +46,7 @@ export class SettingsComponent implements OnInit { }); desktopSettingsForm = new FormGroup({ - desktopClipboard: new FormControl(false), - notification: new FormControl(false) + desktopClipboard: new FormControl(false) }); darkTheme = false;