@eohjsc/react-native-smart-city 0.7.5 → 0.7.7

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.7.5",
4
+ "version": "0.7.7",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -91,6 +91,23 @@ const ScriptDetail = ({ route }) => {
91
91
  });
92
92
  }, [navigate, automateId, type, unit]);
93
93
 
94
+ const handleUpdateAutomate = useCallback(async () => {
95
+ if (!can_edit) {
96
+ ToastBottomHelper.error(
97
+ t('only_owner_has_permission_to_edit_this_script')
98
+ );
99
+ return;
100
+ }
101
+ if (!enableScript) {
102
+ ToastBottomHelper.error(t('this_script_has_been_disabled'));
103
+ return;
104
+ }
105
+ navigate(Routes.AddUnknownTypeSmart, {
106
+ automate,
107
+ closeScreen: route.name,
108
+ });
109
+ }, [automate, can_edit, enableScript, navigate, route.name, t]);
110
+
94
111
  const listMenuItem = useMemo(
95
112
  () => [
96
113
  { text: t('rename'), doAction: () => setIsShowRename(true) },
@@ -175,23 +192,6 @@ const ScriptDetail = ({ route }) => {
175
192
  }
176
193
  }, [automateId, t]);
177
194
 
178
- const handleUpdateAutomate = useCallback(async () => {
179
- if (!can_edit) {
180
- ToastBottomHelper.error(
181
- t('only_owner_has_permission_to_edit_this_script')
182
- );
183
- return;
184
- }
185
- if (!enableScript) {
186
- ToastBottomHelper.error(t('this_script_has_been_disabled'));
187
- return;
188
- }
189
- navigate(Routes.AddUnknownTypeSmart, {
190
- automate,
191
- closeScreen: route.name,
192
- });
193
- }, [automate, can_edit, enableScript, navigate, route.name, t]);
194
-
195
195
  const handleGoBack = useCallback(async () => {
196
196
  if (closeScreen === Routes.UnitDetail) {
197
197
  navigate(closeScreen, { unitId: unit });