1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

First pass at linting lib dir

This commit is contained in:
Laurent Cozic
2019-07-29 15:43:53 +02:00
parent 64b7bc3d62
commit 86dc72b204
170 changed files with 4140 additions and 3119 deletions

View File

@@ -1,12 +1,11 @@
const { PushNotificationIOS } = require('react-native');
class AlarmServiceDriver {
constructor() {
this.hasPermission_ = null;
this.inAppNotificationHandler_ = null;
PushNotificationIOS.addEventListener('localNotification', (instance) => {
PushNotificationIOS.addEventListener('localNotification', instance => {
if (!this.inAppNotificationHandler_) return;
if (!instance || !instance._data || !instance._data.id) {
@@ -24,7 +23,7 @@ class AlarmServiceDriver {
}
notificationIsSet(alarmId) {
throw new Error('Available only for non-persistent alarms');
throw new Error('Available only for non-persistent alarms');
}
setInAppNotificationHandler(v) {
@@ -37,7 +36,7 @@ class AlarmServiceDriver {
if (this.hasPermission_ !== null) return this.hasPermission_;
return new Promise((resolve, reject) => {
PushNotificationIOS.checkPermissions(async (perm) => {
PushNotificationIOS.checkPermissions(async perm => {
const ok = await this.hasPermissions(perm);
this.hasPermission_ = ok;
resolve(ok);
@@ -47,9 +46,9 @@ class AlarmServiceDriver {
async requestPermissions() {
const newPerm = await PushNotificationIOS.requestPermissions({
alert:1,
badge:1,
sound:1,
alert: 1,
badge: 1,
sound: 1,
});
this.hasPermission_ = null;
return this.hasPermissions(newPerm);
@@ -58,7 +57,7 @@ class AlarmServiceDriver {
async clearNotification(id) {
PushNotificationIOS.cancelLocalNotifications({ id: id + '' });
}
async scheduleNotification(notification) {
if (!(await this.hasPermissions())) {
const ok = await this.requestPermissions();
@@ -77,7 +76,6 @@ class AlarmServiceDriver {
PushNotificationIOS.scheduleLocalNotification(iosNotification);
}
}
module.exports = AlarmServiceDriver;
module.exports = AlarmServiceDriver;