Skip to content

Commit

Permalink
fix: push notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
glouvigny committed Aug 28, 2019
1 parent a53ade9 commit 7c62c82
Show file tree
Hide file tree
Showing 48 changed files with 731 additions and 2,698 deletions.
4 changes: 2 additions & 2 deletions client/osx/package-lock.json

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

35 changes: 15 additions & 20 deletions client/packages/bridge/service/api/node/service.pb.json
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
}
},
"pushType": {
"type": "berty.push.DevicePushType",
"type": "push.DevicePushType",
"id": 3
}
}
Expand Down Expand Up @@ -1252,7 +1252,6 @@
"DevtoolsMapset": 401,
"SenderAliasUpdate": 501,
"DeviceUpdatePushConfig": 601,
"DevicePushTo": 602,
"Node": 99
}
},
Expand Down Expand Up @@ -1513,22 +1512,6 @@
}
}
},
"DevicePushToAttrs": {
"fields": {
"pushIdentifier": {
"type": "bytes",
"id": 1
},
"envelope": {
"type": "bytes",
"id": 2
},
"priority": {
"type": "berty.push.Priority",
"id": 3
}
}
},
"NodeAttrs": {
"fields": {
"kind": {
Expand Down Expand Up @@ -2138,7 +2121,7 @@
}
},
"pushType": {
"type": "berty.push.DevicePushType",
"type": "push.DevicePushType",
"id": 5
},
"pushId": {
Expand All @@ -2161,9 +2144,12 @@
},
"push": {
"options": {
"go_package": "berty.tech/core/push"
"go_package": "berty.tech/zero-push/proto/push"
},
"nested": {
"Void": {
"fields": {}
},
"DevicePushType": {
"values": {
"UnknownDevicePushType": 0,
Expand Down Expand Up @@ -2210,6 +2196,15 @@
}
}
},
"PushToInput": {
"fields": {
"pushData": {
"rule": "repeated",
"type": "PushData",
"id": 1
}
}
},
"PushData": {
"fields": {
"pushIdentifier": {
Expand Down
15 changes: 0 additions & 15 deletions client/packages/bridge/service/daemon/daemon.pb.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,21 +194,6 @@
"type": "bool",
"id": 8
},
"apnsCerts": {
"rule": "repeated",
"type": "string",
"id": 9
},
"apnsDevVoipCerts": {
"rule": "repeated",
"type": "string",
"id": 10
},
"fcmAPIKeys": {
"rule": "repeated",
"type": "string",
"id": 11
},
"privateKeyFile": {
"type": "string",
"id": 12
Expand Down
16 changes: 14 additions & 2 deletions client/packages/bridge/service/entity/device_push_config.pb.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
},
"pushType": {
"type": "berty.push.DevicePushType",
"type": "push.DevicePushType",
"id": 5
},
"pushId": {
Expand All @@ -64,9 +64,12 @@
},
"push": {
"options": {
"go_package": "berty.tech/core/push"
"go_package": "berty.tech/zero-push/proto/push"
},
"nested": {
"Void": {
"fields": {}
},
"DevicePushType": {
"values": {
"UnknownDevicePushType": 0,
Expand Down Expand Up @@ -113,6 +116,15 @@
}
}
},
"PushToInput": {
"fields": {
"pushData": {
"rule": "repeated",
"type": "PushData",
"id": 1
}
}
},
"PushData": {
"fields": {
"pushIdentifier": {
Expand Down
86 changes: 0 additions & 86 deletions client/packages/bridge/service/entity/event.pb.json
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@
"DevtoolsMapset": 401,
"SenderAliasUpdate": 501,
"DeviceUpdatePushConfig": 601,
"DevicePushTo": 602,
"Node": 99
}
},
Expand Down Expand Up @@ -580,22 +579,6 @@
}
}
},
"DevicePushToAttrs": {
"fields": {
"pushIdentifier": {
"type": "bytes",
"id": 1
},
"envelope": {
"type": "bytes",
"id": 2
},
"priority": {
"type": "berty.push.Priority",
"id": 3
}
}
},
"NodeAttrs": {
"fields": {
"kind": {
Expand Down Expand Up @@ -1078,75 +1061,6 @@
}
}
}
},
"push": {
"options": {
"go_package": "berty.tech/core/push"
},
"nested": {
"DevicePushType": {
"values": {
"UnknownDevicePushType": 0,
"APNS": 1,
"FCM": 2,
"MQTT": 3
}
},
"Priority": {
"values": {
"UnknownPriority": 0,
"Low": 1,
"Normal": 2
}
},
"PushDestination": {
"fields": {
"nonce": {
"type": "bytes",
"id": 1
},
"pushType": {
"type": "DevicePushType",
"id": 2
},
"pushId": {
"type": "bytes",
"id": 3
}
}
},
"PushNativeIdentifier": {
"fields": {
"packageId": {
"type": "string",
"id": 1,
"options": {
"(gogoproto.customname)": "PackageID"
}
},
"deviceToken": {
"type": "string",
"id": 2
}
}
},
"PushData": {
"fields": {
"pushIdentifier": {
"type": "bytes",
"id": 1
},
"envelope": {
"type": "bytes",
"id": 2
},
"priority": {
"type": "Priority",
"id": 3
}
}
}
}
}
}
},
Expand Down
86 changes: 0 additions & 86 deletions client/packages/bridge/service/entity/kind.pb.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"DevtoolsMapset": 401,
"SenderAliasUpdate": 501,
"DeviceUpdatePushConfig": 601,
"DevicePushTo": 602,
"Node": 99
}
},
Expand Down Expand Up @@ -295,22 +294,6 @@
}
}
},
"DevicePushToAttrs": {
"fields": {
"pushIdentifier": {
"type": "bytes",
"id": 1
},
"envelope": {
"type": "bytes",
"id": 2
},
"priority": {
"type": "berty.push.Priority",
"id": 3
}
}
},
"NodeAttrs": {
"fields": {
"kind": {
Expand Down Expand Up @@ -793,75 +776,6 @@
}
}
}
},
"push": {
"options": {
"go_package": "berty.tech/core/push"
},
"nested": {
"DevicePushType": {
"values": {
"UnknownDevicePushType": 0,
"APNS": 1,
"FCM": 2,
"MQTT": 3
}
},
"Priority": {
"values": {
"UnknownPriority": 0,
"Low": 1,
"Normal": 2
}
},
"PushDestination": {
"fields": {
"nonce": {
"type": "bytes",
"id": 1
},
"pushType": {
"type": "DevicePushType",
"id": 2
},
"pushId": {
"type": "bytes",
"id": 3
}
}
},
"PushNativeIdentifier": {
"fields": {
"packageId": {
"type": "string",
"id": 1,
"options": {
"(gogoproto.customname)": "PackageID"
}
},
"deviceToken": {
"type": "string",
"id": 2
}
}
},
"PushData": {
"fields": {
"pushIdentifier": {
"type": "bytes",
"id": 1
},
"envelope": {
"type": "bytes",
"id": 2
},
"priority": {
"type": "Priority",
"id": 3
}
}
}
}
}
}
},
Expand Down
11 changes: 7 additions & 4 deletions client/packages/screen/Settings/Notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ export class Notifications extends PureComponent {
getCurrentConfig = () => this.props.config

state = {
pushConfigsSwitch: this.getCurrentPushConfigs().length > 0,
mqttConfigsSwitch: this.getCurrentMQTTConfigs().length > 0,
notificationsEnabled: this.getCurrentConfig().notificationsEnabled,
notificationsPreviews: this.getCurrentConfig().notificationsPreviews,
}
Expand Down Expand Up @@ -78,7 +76,8 @@ export class Notifications extends PureComponent {
const { t, context } = this.props
const nativePushType = getNativePushType()
const currentMQTTConfigs = this.getCurrentMQTTConfigs()
const { pushConfigsSwitch, mqttConfigsSwitch } = this.state
const pushConfigsSwitch = this.getCurrentPushConfigs().length > 0
const mqttConfigsSwitch = this.getCurrentMQTTConfigs().length > 0

return (
<Menu>
Expand Down Expand Up @@ -261,7 +260,11 @@ class NotificationWrapper extends React.PureComponent {
fallback={<Loader />}
>
{({ queue, retry }) => (
<Notifications data={queue} refresh={retry} config={config} />
<Notifications
data={[...queue]}
refresh={retry}
config={config}
/>
)}
</Store.Node.Service.DevicePushConfigList>
) : (
Expand Down

0 comments on commit 7c62c82

Please sign in to comment.