You've already forked joplin
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user