Leon 1 anno fa
parent
commit
32179cdf3c
1 ha cambiato i file con 12 aggiunte e 8 eliminazioni
  1. 12 8
      src/pages/notification/setting.tsx

+ 12 - 8
src/pages/notification/setting.tsx

@@ -92,6 +92,7 @@ export default function Page() {
     function getMemberStatus() {
         userAccess().then(res => {
             setAccess(res)
+            console.log(res)
             if ((res as any).member.status == 'NON_MEMBER') {
                 postNotifySettings({
                     notification: {
@@ -261,7 +262,7 @@ export default function Page() {
                 <View className="setting_cell_group">
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Sunrise</Text>
-                        <Switch className="myswitch" checked={isSunrise} color={ColorType.fast} onChange={(e) => {
+                        <Switch className="myswitch" value={isSunrise} color={ColorType.fast} trackColor={{ true: ColorType.fast }} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
                             const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
@@ -284,7 +285,7 @@ export default function Page() {
                                     }
                                 }
                             }).then(res => {
-                                setIsExtra(value)
+                                setIsSunrise(value)
                                 // setIsSunrise(e.nativeEvent.value)
                                 global.swiperDayNightRefresh()
                             })
@@ -292,8 +293,9 @@ export default function Page() {
                     </View>
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Sunset</Text>
-                        <Switch className="myswitch" checked={isSunset} color={ColorType.fast} onChange={(e) => {
+                        <Switch className="myswitch" value={isSunset} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
+                            const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
                                 if (access.member.status == 'NON_MEMBER') {
                                     setTimeout(() => {
@@ -309,20 +311,21 @@ export default function Page() {
                                 notification: {
                                     follow_sun: {
                                         sunset: {
-                                            in_app: e.nativeEvent.value ? 'ON' : 'OFF'
+                                            in_app: value ? 'ON' : 'OFF'
                                         }
                                     }
                                 }
                             }).then(res => {
-                                setIsSunset(e.nativeEvent.value)
+                                setIsSunset(value)
                                 global.swiperDayNightRefresh()
                             })
                         }} />
                     </View>
                     <View className="setting_cell_group_item">
                         <Text className="setting_cell_title" style={{ flex: 1 }}>Solar Noon</Text>
-                        <Switch className="myswitch" checked={isSolarNoon} color={ColorType.fast} onChange={(e) => {
+                        <Switch className="myswitch" value={isSolarNoon} trackColor={{ true: ColorType.fast }} color={ColorType.fast} onChange={(e) => {
                             // setIsMulti(e.nativeEvent.value)
+                            const value = e.nativeEvent.value
                             if (e.nativeEvent.value) {
                                 if (access.member.status == 'NON_MEMBER') {
                                     setTimeout(() => {
@@ -338,12 +341,13 @@ export default function Page() {
                                 notification: {
                                     follow_sun: {
                                         solar_noon: {
-                                            in_app: e.nativeEvent.value ? 'ON' : 'OFF'
+                                            in_app: value ? 'ON' : 'OFF'
                                         }
                                     }
                                 }
                             }).then(res => {
-                                setIsSolarNoon(e.nativeEvent.value)
+                                debugger
+                                setIsSolarNoon(value)
                                 global.swiperDayNightRefresh()
                             })
                         }} />