|
@@ -36,7 +36,7 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
|
|
|
getLatestLocation()
|
|
getLatestLocation()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- global.updateSwiper = ()=>{
|
|
|
|
|
|
|
+ global.updateSwiper = () => {
|
|
|
getLatestLocation()
|
|
getLatestLocation()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -102,21 +102,21 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (sunrise && item.sunrise_ts) {
|
|
|
|
|
|
|
+ if (sunrise && item.sunrise_ts && item.push) {
|
|
|
list.push({
|
|
list.push({
|
|
|
channel_id: 'REMINDER_SUN',
|
|
channel_id: 'REMINDER_SUN',
|
|
|
category_id: 'REMINDER_SUN_RISE',
|
|
category_id: 'REMINDER_SUN_RISE',
|
|
|
- title: `Sunrise at ${dayjs(item.sunrise_ts).format('HH:mm')}`,
|
|
|
|
|
- body: `Daylight lasts ${dayDuration}.`,
|
|
|
|
|
|
|
+ title: item.push.sunrise_title,
|
|
|
|
|
+ body: item.push.sunrise_body,
|
|
|
timestamp: item.sunrise_ts
|
|
timestamp: item.sunrise_ts
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
- if (sunset && item.sunset_ts) {
|
|
|
|
|
|
|
+ if (sunset && item.sunset_ts && item.push) {
|
|
|
list.push({
|
|
list.push({
|
|
|
channel_id: 'REMINDER_SUN',
|
|
channel_id: 'REMINDER_SUN',
|
|
|
category_id: 'REMINDER_SUN_SET',
|
|
category_id: 'REMINDER_SUN_SET',
|
|
|
- title: `Sunset at ${dayjs(item.sunset_ts).format('HH:mm')}`,
|
|
|
|
|
- body: `The night lasts ${nightDuration}.`,
|
|
|
|
|
|
|
+ title: item.push.sunset_title,
|
|
|
|
|
+ body: item.push.sunset_body,
|
|
|
timestamp: item.sunset_ts
|
|
timestamp: item.sunset_ts
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -124,8 +124,8 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
|
|
|
list.push({
|
|
list.push({
|
|
|
channel_id: 'REMINDER_SUN',
|
|
channel_id: 'REMINDER_SUN',
|
|
|
category_id: 'REMINDER_SUN_SOLAR_NOON',
|
|
category_id: 'REMINDER_SUN_SOLAR_NOON',
|
|
|
- title: `Solar Noon at ${dayjs(item.solar_noon_ts).format('HH:mm')}`,
|
|
|
|
|
- body: 'The Sun is currently at its highest point in the sky for the day.',
|
|
|
|
|
|
|
+ title: item.push.solar_noon_title,
|
|
|
|
|
+ body: item.push.solar_noon_body,
|
|
|
timestamp: item.solar_noon_ts
|
|
timestamp: item.solar_noon_ts
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -133,11 +133,11 @@ export default function DayNightSwiper(props: { count: number, schedule: any, ho
|
|
|
}
|
|
}
|
|
|
if (process.env.TARO_ENV == 'rn') {
|
|
if (process.env.TARO_ENV == 'rn') {
|
|
|
var Jto = require('react-native').NativeModules.NativeBridge;
|
|
var Jto = require('react-native').NativeModules.NativeBridge;
|
|
|
- if (list.length==0){
|
|
|
|
|
|
|
+ if (list.length == 0) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
if (kIsIOS) {
|
|
if (kIsIOS) {
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
Jto.addSunPush(list)
|
|
Jto.addSunPush(list)
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|