@eohjsc/react-native-smart-city 0.6.0-rc4 → 0.6.0-rc5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eohjsc/react-native-smart-city",
|
|
3
3
|
"title": "React Native Smart Home",
|
|
4
|
-
"version": "0.6.0-
|
|
4
|
+
"version": "0.6.0-rc5",
|
|
5
5
|
"description": "TODO",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"files": [
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
"pluralize": "^8.0.0",
|
|
126
126
|
"postinstall": "^0.7.0",
|
|
127
127
|
"precompiled-mqtt": "^4.3.14-beta",
|
|
128
|
-
"pusher-js": "^
|
|
128
|
+
"pusher-js": "^8.4.0-rc2",
|
|
129
129
|
"pusher-js-auth": "^4.0.1",
|
|
130
130
|
"python-struct": "^1.1.3",
|
|
131
131
|
"querystring": "^0.2.0",
|
|
@@ -15,7 +15,7 @@ const SharedStack = memo(() => {
|
|
|
15
15
|
const t = useTranslations();
|
|
16
16
|
const { toggleDrawer, goBack } = useNavigation();
|
|
17
17
|
const { params } = useRoute();
|
|
18
|
-
const { isMainSource } = params;
|
|
18
|
+
const { isMainSource } = params || {};
|
|
19
19
|
return (
|
|
20
20
|
<Stack.Navigator>
|
|
21
21
|
<Stack.Screen
|
|
@@ -755,7 +755,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
755
755
|
>
|
|
756
756
|
{display.items.map((item, index) => {
|
|
757
757
|
return (
|
|
758
|
-
|
|
758
|
+
<View key={item?.id?.toString()}>
|
|
759
759
|
{!item.is_configuration_ready && (
|
|
760
760
|
<Text center>{t('bellow_widget_is_not_configured')}</Text>
|
|
761
761
|
)}
|
|
@@ -779,7 +779,7 @@ const DeviceDetail = ({ route }) => {
|
|
|
779
779
|
setShowWindDirection={setShowWindDirection}
|
|
780
780
|
background={station?.background}
|
|
781
781
|
/>
|
|
782
|
-
|
|
782
|
+
</View>
|
|
783
783
|
);
|
|
784
784
|
})}
|
|
785
785
|
</SensorConnectStatusViewHeader>
|
|
@@ -10,6 +10,7 @@ import TextInput from '../../../commons/Form/TextInput';
|
|
|
10
10
|
import { ModalCustom } from '../../../commons/Modal';
|
|
11
11
|
import { TouchableOpacity } from 'react-native';
|
|
12
12
|
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
13
|
+
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
13
14
|
|
|
14
15
|
const wrapComponent = (route) => (
|
|
15
16
|
<SCProvider initState={mockSCStore({})}>
|
|
@@ -137,7 +138,7 @@ describe('Test GroupButtonByType', () => {
|
|
|
137
138
|
await act(async () => {
|
|
138
139
|
await touch.props.onPress();
|
|
139
140
|
});
|
|
140
|
-
expect(icon.props.name).toEqual('
|
|
141
|
+
expect(icon.props.name).toEqual('reload1');
|
|
141
142
|
|
|
142
143
|
const touch2 = instance.find(
|
|
143
144
|
(el) =>
|
|
@@ -145,14 +146,14 @@ describe('Test GroupButtonByType', () => {
|
|
|
145
146
|
AccessibilityLabel.HEADER_BUTTON_TYPE_MORE &&
|
|
146
147
|
el.type === TouchableOpacity
|
|
147
148
|
);
|
|
148
|
-
const
|
|
149
|
+
const moreIcon = instance.find(
|
|
149
150
|
(el) =>
|
|
150
151
|
el.props.accessibilityLabel ===
|
|
151
|
-
AccessibilityLabel.ICON_OUTLINE_TYPE_MORE && el.type ===
|
|
152
|
+
AccessibilityLabel.ICON_OUTLINE_TYPE_MORE && el.type === MaterialIcons
|
|
152
153
|
);
|
|
153
154
|
await act(async () => {
|
|
154
155
|
await touch2.props.onPress();
|
|
155
156
|
});
|
|
156
|
-
expect(
|
|
157
|
+
expect(moreIcon.props.name).toEqual('more-vert');
|
|
157
158
|
});
|
|
158
159
|
});
|
package/src/utils/Monitor.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { getPusher, destroyPusher } from './Pusher';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// channel.bind('new-notification', callback);
|
|
3
|
+
export const watchNotificationData = (user, handler) => {
|
|
4
|
+
const channel = getPusher().subscribe(`private-user-${user.id}`);
|
|
5
|
+
channel.bind('new-notification', handler);
|
|
7
6
|
};
|
|
8
7
|
|
|
9
8
|
export const unwatchNotificationData = (user) => {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
getPusher().unsubscribe(`private-user-${user.id}`);
|
|
10
|
+
destroyPusher();
|
|
12
11
|
};
|