mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-18 10:52:16 +03:00
lint
This commit is contained in:
parent
1cc4795ef3
commit
e14c8459ce
@ -464,9 +464,7 @@ const MarkdownEditorView = ({
|
||||
animationType="slide"
|
||||
style={styles.modalStyle}
|
||||
>
|
||||
<SnippetsModal
|
||||
handleOnSelect={_handleOnSnippetReceived}
|
||||
/>
|
||||
<SnippetsModal handleOnSelect={_handleOnSnippetReceived} />
|
||||
</Modal>
|
||||
|
||||
<UploadsGalleryModal
|
||||
|
@ -274,7 +274,7 @@ class ProfileContainer extends Component {
|
||||
const res = await getRelationship(currentAccount.name, username);
|
||||
_isFollowing = res && res.follows;
|
||||
_isMuted = res && res.ignores;
|
||||
isFavorite = await checkFavorite(username)
|
||||
isFavorite = await checkFavorite(username);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -296,12 +296,14 @@ class ProfileContainer extends Component {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(error){
|
||||
console.warn("Failed to fetch complete profile data", error);
|
||||
Alert.alert(intl.formatMessage({
|
||||
} catch (error) {
|
||||
console.warn('Failed to fetch complete profile data', error);
|
||||
Alert.alert(
|
||||
intl.formatMessage({
|
||||
id: 'alert.fail',
|
||||
}), error.message || error.toString())
|
||||
}),
|
||||
error.message || error.toString(),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@ -359,25 +361,26 @@ class ProfileContainer extends Component {
|
||||
favoriteAction = addFavorite;
|
||||
}
|
||||
|
||||
favoriteAction(username).then(() => {
|
||||
dispatch(
|
||||
toastNotification(
|
||||
favoriteAction(username)
|
||||
.then(() => {
|
||||
dispatch(
|
||||
toastNotification(
|
||||
intl.formatMessage({
|
||||
id: isFavorite ? 'alert.success_unfavorite' : 'alert.success_favorite',
|
||||
}),
|
||||
),
|
||||
);
|
||||
this.setState({ isFavorite: !isFavorite, isProfileLoading: false });
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn('Failed to perform favorite action');
|
||||
Alert.alert(
|
||||
intl.formatMessage({
|
||||
id: isFavorite ? 'alert.success_unfavorite' : 'alert.success_favorite',
|
||||
id: 'alert.fail',
|
||||
}),
|
||||
),
|
||||
);
|
||||
this.setState({ isFavorite: !isFavorite, isProfileLoading: false });
|
||||
})
|
||||
.catch((error)=>{
|
||||
console.warn("Failed to perform favorite action")
|
||||
Alert.alert(
|
||||
intl.formatMessage({
|
||||
id: 'alert.fail',
|
||||
}),
|
||||
error.message || error.toString()
|
||||
)
|
||||
});
|
||||
error.message || error.toString(),
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
_handleOnBackPress = () => {
|
||||
|
@ -43,7 +43,11 @@ import {
|
||||
} from '../../../realm/realm';
|
||||
import { getUser, getPost } from '../../../providers/hive/dhive';
|
||||
import { migrateToMasterKeyWithAccessToken, switchAccount } from '../../../providers/hive/auth';
|
||||
import { setPushToken, markActivityAsRead, markNotifications } from '../../../providers/ecency/ecency';
|
||||
import {
|
||||
setPushToken,
|
||||
markActivityAsRead,
|
||||
markNotifications,
|
||||
} from '../../../providers/ecency/ecency';
|
||||
import { navigate } from '../../../navigation/service';
|
||||
|
||||
// Actions
|
||||
|
@ -101,7 +101,7 @@ const DraftsContainer = ({ currentAccount, intl, navigation, dispatch }) => {
|
||||
_getSchedules();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("Failed to move scheduled post to drafts")
|
||||
console.warn('Failed to move scheduled post to drafts');
|
||||
dispatch(toastNotification(intl.formatMessage({ id: 'alert.fail' })));
|
||||
});
|
||||
};
|
||||
|
@ -945,7 +945,8 @@ class EditorContainer extends Component {
|
||||
data.jsonMeta,
|
||||
options,
|
||||
data.scheduleDate,
|
||||
) .then(() => {
|
||||
)
|
||||
.then(() => {
|
||||
this.setState({
|
||||
isPostSending: false,
|
||||
});
|
||||
@ -973,7 +974,7 @@ class EditorContainer extends Component {
|
||||
}, 3000);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.warn("Failed to schedule post", error);
|
||||
console.warn('Failed to schedule post', error);
|
||||
this.setState({
|
||||
isPostSending: false,
|
||||
});
|
||||
|
@ -42,7 +42,7 @@ class NotificationContainer extends Component {
|
||||
|
||||
if (!endOfNotification || !loadMore) {
|
||||
this.setState({ isNotificationRefreshing: true });
|
||||
getNotifications({ filter:type, since:since })
|
||||
getNotifications({ filter: type, since: since })
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
const lastId = res.length > 0 ? [...res].pop().id : null;
|
||||
@ -73,7 +73,7 @@ class NotificationContainer extends Component {
|
||||
let params;
|
||||
let key;
|
||||
markNotifications(data.id).then((result) => {
|
||||
const {unread} = result;
|
||||
const { unread } = result;
|
||||
dispatch(updateUnreadActivityCount(unread));
|
||||
});
|
||||
|
||||
@ -150,9 +150,7 @@ class NotificationContainer extends Component {
|
||||
(nextProps.activeBottomTab === ROUTES.TABBAR.NOTIFICATION && nextProps.username) ||
|
||||
(nextProps.username !== username && nextProps.username)
|
||||
) {
|
||||
this.setState({ endOfNotification: false }, () =>
|
||||
this._getActivities(selectedFilter),
|
||||
);
|
||||
this.setState({ endOfNotification: false }, () => this._getActivities(selectedFilter));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,19 +49,17 @@ const RegisterContainer = ({ children, navigation }) => {
|
||||
})
|
||||
.catch((err) => {
|
||||
if (get(err, 'response.status') === 500) {
|
||||
Alert.alert(intl.formatMessage(
|
||||
{ id: 'alert.fail'}),
|
||||
intl.formatMessage({ id: 'register.500_error' }));
|
||||
}
|
||||
else if (get(err, 'response.data.message')) {
|
||||
Alert.alert(intl.formatMessage(
|
||||
{ id: 'alert.fail'}),
|
||||
err.response.data.message);
|
||||
}
|
||||
else {
|
||||
Alert.alert(intl.formatMessage(
|
||||
{ id: 'alert.fail'}),
|
||||
intl.formatMessage({ id: 'alert.unknow_error' }));
|
||||
Alert.alert(
|
||||
intl.formatMessage({ id: 'alert.fail' }),
|
||||
intl.formatMessage({ id: 'register.500_error' }),
|
||||
);
|
||||
} else if (get(err, 'response.data.message')) {
|
||||
Alert.alert(intl.formatMessage({ id: 'alert.fail' }), err.response.data.message);
|
||||
} else {
|
||||
Alert.alert(
|
||||
intl.formatMessage({ id: 'alert.fail' }),
|
||||
intl.formatMessage({ id: 'alert.unknow_error' }),
|
||||
);
|
||||
}
|
||||
setIsLoading(false);
|
||||
});
|
||||
|
@ -100,12 +100,12 @@ const PostsResultsContainer = ({ children, navigation, searchValue }) => {
|
||||
const _loadMore = (index, value) => {
|
||||
if (scrollId && searchValue) {
|
||||
search({ q: `${searchValue} type:post`, sort, scroll_id: scrollId })
|
||||
.then((res) => {
|
||||
setData([...data, ...res.results]);
|
||||
})
|
||||
.catch(()=>{
|
||||
console.warn("Search Failed");
|
||||
})
|
||||
.then((res) => {
|
||||
setData([...data, ...res.results]);
|
||||
})
|
||||
.catch(() => {
|
||||
console.warn('Search Failed');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user