parent
c0cb14e927
commit
db18151a67
3 changed files with 8 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import {t} from '@i18n';
|
|||
import NetworkManager from '@managers/network_manager';
|
||||
import {getDeviceToken} from '@queries/app/global';
|
||||
import {getExpandedLinks, getPushVerificationStatus} from '@queries/servers/system';
|
||||
import {logDebug} from '@utils/log';
|
||||
|
||||
import {forceLogoutIfNecessary} from './session';
|
||||
|
||||
|
|
@ -63,10 +64,12 @@ export const doPing = async (serverUrl: string, verifyPushProxy: boolean, timeou
|
|||
}
|
||||
|
||||
if (!response.ok) {
|
||||
logDebug('Server ping returned not ok response', response);
|
||||
NetworkManager.invalidateClient(serverUrl);
|
||||
return {error: {intl: pingError}};
|
||||
}
|
||||
} catch (error) {
|
||||
logDebug('Server ping threw an exception', error);
|
||||
NetworkManager.invalidateClient(serverUrl);
|
||||
return {error: {intl: pingError}};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import {queryAllUsers} from '@queries/servers/user';
|
|||
import {setFetchingThreadState} from '@store/fetching_thread_store';
|
||||
import {getValidEmojis, matchEmoticons} from '@utils/emoji/helpers';
|
||||
import {isServerError} from '@utils/errors';
|
||||
import {logError} from '@utils/log';
|
||||
import {logDebug, logError} from '@utils/log';
|
||||
import {processPostsFetched} from '@utils/post';
|
||||
import {getPostIdsForCombinedUserActivityPost} from '@utils/post_list';
|
||||
|
||||
|
|
@ -136,6 +136,7 @@ export async function createPost(serverUrl: string, post: Partial<Post>, files:
|
|||
try {
|
||||
created = await client.createPost(newPost);
|
||||
} catch (error) {
|
||||
logDebug('Error sending a post', error);
|
||||
const errorPost = {
|
||||
...newPost,
|
||||
id: pendingPostId,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {subscribeAllServers} from '@database/subscription/servers';
|
|||
import {subscribeUnreadAndMentionsByServer, UnreadObserverArgs} from '@database/subscription/unreads';
|
||||
import {useAppState} from '@hooks/device';
|
||||
import NativeNotification from '@notifications';
|
||||
import {logDebug} from '@utils/log';
|
||||
import {changeOpacity} from '@utils/theme';
|
||||
|
||||
import type ServersModel from '@typings/database/models/app/servers';
|
||||
|
|
@ -56,9 +57,11 @@ const Home = ({isFocused, theme}: Props) => {
|
|||
if (Platform.OS === 'ios') {
|
||||
NativeNotification.getDeliveredNotifications().then((delivered) => {
|
||||
if (mentions === 0 && delivered.length > 0) {
|
||||
logDebug('Not updating badge count, since we have no mentions in the database, and the number of notifications in the notification center is', delivered.length);
|
||||
return;
|
||||
}
|
||||
|
||||
logDebug('Setting the badge count based on database values to', mentions);
|
||||
Notifications.ios.setBadgeCount(mentions);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue