-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement wifi no-download alert #55
base: master
Are you sure you want to change the base?
Conversation
@@ -64,7 +65,19 @@ const AllLessons = ({route}: {route: any}) => { | |||
}, | |||
{ | |||
text: 'OK', | |||
onPress: () => { | |||
onPress: async() => { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
del
|
||
const [wifiOnly, network] = await Promise.all([ | ||
genPreferenceDownloadOnlyOnWifi(), | ||
NetInfo.fetch() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
,
|
||
if (wifiOnly && network.type !== 'wifi') { | ||
Alert.alert(`You\'re not currently connected to wi-fi, and your preferences don\'t allow downloads over data. | ||
\nPlease go to your Language Transfer settings and disable "Download Only on wi-fi" to continue.`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowercase the o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's put '\n' on the prev line
const [wifiOnly, network] = await Promise.all([ | ||
genPreferenceDownloadOnlyOnWifi(), | ||
NetInfo.fetch() | ||
]); | ||
|
||
if (wifiOnly && network.type !== 'wifi') { | ||
Alert.alert(`You\'re not currently connected to wi-fi, and your preferences don\'t allow downloads over data. | ||
\nPlease go to your Language Transfer settings and disable "Download Only on wi-fi" to continue.`); | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dedup the entire block, put it somewhere vaguely in js/
if (wifiOnly && network.type !== 'wifi') { | ||
Alert.alert(`You\'re not currently connected to wi-fi, and your preferences don\'t allow downloads over data. | ||
\nPlease go to your Language Transfer settings and disable "Download Only on wi-fi" to continue.`); | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's not return. and workshop the copy a bit
]); | ||
|
||
if (wifiOnly && network.type !== 'wifi') { | ||
Alert.alert(`You\'re not currently connected to wi-fi, and your preferences don\'t allow downloads over data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't think you need backslashes here
01e4b8c
to
76b1538
Compare
Known issues: clicking "download all" will initialize n notifications and probably crash the app.