Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
renderError() {
const {
error,
networkType,
isConnected,
width,
} = this.props;
if (!error && networkType !== NetInfoStateType.none) {
return null;
}
if (!isConnected || networkType === NetInfoStateType.none) {
return (
);
}
if (error === 'badAccessToken') {
return (
);
renderError() {
const {
error,
networkType,
isConnected,
width,
} = this.props;
if (!error && networkType !== NetInfoStateType.none) {
return null;
}
if (!isConnected || networkType === NetInfoStateType.none) {
return (
);
}
if (error === 'badAccessToken') {
return (
{ t`New Name` }
{ this.renderDeckSelector() }
{ t`Deck Type` }
{ (!isConnected || networkType === NetInfoStateType.none) && (
{ t`You seem to be offline. Refresh Network?` }
) }
{ !!error && (
{ t`Deck Type` }
{ !signedIn && (
{ t`Visit Settings to sign in to ArkhamDB.` }
) }
{ (!isConnected || networkType === NetInfoStateType.none) && (
{ t`You seem to be offline. Refresh Network?` }
) }
{ hasStarterDeck && (
) }
);
const {
signedIn,
networkType,
isConnected,
saveNewDeck,
} = this.props;
const {
deckName,
offlineDeck,
saving,
starterDeck,
tabooSetId,
} = this.state;
const investigator = this.investigator();
if (investigator && (!saving || isRetry)) {
const local = (offlineDeck || !signedIn || !isConnected || networkType === NetInfoStateType.none);
let slots = this.getSlots();
if (starterDeck && starterDecks[investigator.code]) {
slots = starterDecks[investigator.code];
}
this.setState({
saving: true,
});
saveNewDeck({
local,
deckName: deckName || t`New Deck`,
investigatorCode: investigator.code,
slots: slots,
tabooSetId,
}).then(
this._showNewDeck,
() => {
{ this.renderDeckSelector() }
{ t`Deck Type` }
{ (!isConnected || networkType === NetInfoStateType.none) && (
{ t`You seem to be offline. Refresh Network?` }
) }
{ !!error && (
) }