mirror of
https://github.com/jellyfin/jellyfin-expo.git
synced 2024-12-03 11:40:53 +00:00
Merge pull request #185 from thornbill/add-invalid-server-screen
Add error screen when saved server is invalid
This commit is contained in:
commit
26f3583927
@ -40,12 +40,14 @@ const ErrorView = ({
|
||||
<Text key={`errorview-details-${index}`} style={styles.details}>{detailText}</Text>
|
||||
))}
|
||||
</View>
|
||||
<Button
|
||||
containerStyle={styles.footer}
|
||||
icon={buttonIcon}
|
||||
title={buttonTitle}
|
||||
onPress={onPress}
|
||||
/>
|
||||
{buttonTitle && (
|
||||
<Button
|
||||
containerStyle={styles.footer}
|
||||
icon={buttonIcon}
|
||||
title={buttonTitle}
|
||||
onPress={onPress}
|
||||
/>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
};
|
||||
@ -62,8 +64,8 @@ ErrorView.propTypes = {
|
||||
name: PropTypes.string,
|
||||
type: PropTypes.string
|
||||
}),
|
||||
buttonTitle: PropTypes.string.isRequired,
|
||||
onPress: PropTypes.func.isRequired
|
||||
buttonTitle: PropTypes.string,
|
||||
onPress: PropTypes.func
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
|
@ -31,6 +31,10 @@
|
||||
"heading": "Something went wrong!",
|
||||
"description": "The Jellyfin server returned an error."
|
||||
},
|
||||
"invalidServer": {
|
||||
"heading": "Server is invalid",
|
||||
"description": "Something has happened and the saved server information is invalid. Try removing the server from Settings and add it again."
|
||||
},
|
||||
"offline": {
|
||||
"heading": "Server offline?",
|
||||
"description": "Error contacting Jellyfin server."
|
||||
|
@ -89,7 +89,7 @@ const HomeScreen = observer(() => {
|
||||
{Platform.OS === 'ios' && !rootStore.isFullscreen && (
|
||||
<View style={styles.statusBarSpacer} />
|
||||
)}
|
||||
{server && server.urlString && (
|
||||
{server && server.urlString ? (
|
||||
<NativeShellWebView
|
||||
ref={webview}
|
||||
style={webviewStyle}
|
||||
@ -142,6 +142,11 @@ const HomeScreen = observer(() => {
|
||||
setIsLoading(false);
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<ErrorView
|
||||
heading={t('home.errors.invalidServer.heading')}
|
||||
message={t('home.errors.invalidServer.description')}
|
||||
/>
|
||||
)}
|
||||
</SafeAreaView>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user