mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-11-22 14:18:32 +03:00
imporved babel script, put back important logs and redux logger
This commit is contained in:
parent
ba13c13a1b
commit
f5dd78e415
@ -1,4 +1,13 @@
|
|||||||
module.exports = {
|
module.exports = (api) => {
|
||||||
presets: ['module:metro-react-native-babel-preset'],
|
const babelEnv = api.env();
|
||||||
sourceMaps: true,
|
const plugins = [];
|
||||||
|
//change to 'production' to check if this is working in 'development' mode
|
||||||
|
if (babelEnv !== 'development') {
|
||||||
|
plugins.push(['transform-remove-console', { exclude: ['error', 'warn'] }]);
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
presets: ['module:metro-react-native-babel-preset'],
|
||||||
|
sourceMaps: true,
|
||||||
|
plugins,
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
05B6C4B024C306CE00B7FA60 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 980BC9BC0D3B4AC69645C842 /* Zocial.ttf */; };
|
05B6C4B024C306CE00B7FA60 /* Zocial.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 980BC9BC0D3B4AC69645C842 /* Zocial.ttf */; };
|
||||||
0A1D279E0D3CD306C889592E /* libPods-Ecency-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7093E51BBC0EE2F41AB19EBA /* libPods-Ecency-tvOS.a */; };
|
0A1D279E0D3CD306C889592E /* libPods-Ecency-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7093E51BBC0EE2F41AB19EBA /* libPods-Ecency-tvOS.a */; };
|
||||||
1CD0B89E258019B600A7D78E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1CD0B89B258019B600A7D78E /* GoogleService-Info.plist */; };
|
1CD0B89E258019B600A7D78E /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1CD0B89B258019B600A7D78E /* GoogleService-Info.plist */; };
|
||||||
2B3CF3607B7CB9B7296FD5EF /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
|
2B3CF3607B7CB9B7296FD5EF /* (null) in Frameworks */ = {isa = PBXBuildFile; };
|
||||||
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
|
||||||
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
|
||||||
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
|
||||||
@ -55,7 +55,7 @@
|
|||||||
CFAA2A599FD65F360D9B3E1E /* libPods-EcencyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B344CAA24725C973F48BE81E /* libPods-EcencyTests.a */; };
|
CFAA2A599FD65F360D9B3E1E /* libPods-EcencyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B344CAA24725C973F48BE81E /* libPods-EcencyTests.a */; };
|
||||||
D71EB20EDB9B987C0574BAFE /* libPods-EcencyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C97456BE898C00B5EDA21C2E /* libPods-EcencyTests.a */; };
|
D71EB20EDB9B987C0574BAFE /* libPods-EcencyTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C97456BE898C00B5EDA21C2E /* libPods-EcencyTests.a */; };
|
||||||
DC0E25610BB5F49AFF4514AD /* libPods-Ecency.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 388DF3FF85F08109F722083B /* libPods-Ecency.a */; };
|
DC0E25610BB5F49AFF4514AD /* libPods-Ecency.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 388DF3FF85F08109F722083B /* libPods-Ecency.a */; };
|
||||||
F77F6C7E54F3C783A2773E9D /* BuildFile in Frameworks */ = {isa = PBXBuildFile; };
|
F77F6C7E54F3C783A2773E9D /* (null) in Frameworks */ = {isa = PBXBuildFile; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXContainerItemProxy section */
|
/* Begin PBXContainerItemProxy section */
|
||||||
@ -204,8 +204,8 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
05B6C49424C306CE00B7FA60 /* StoreKit.framework in Frameworks */,
|
05B6C49424C306CE00B7FA60 /* StoreKit.framework in Frameworks */,
|
||||||
F77F6C7E54F3C783A2773E9D /* BuildFile in Frameworks */,
|
F77F6C7E54F3C783A2773E9D /* (null) in Frameworks */,
|
||||||
2B3CF3607B7CB9B7296FD5EF /* BuildFile in Frameworks */,
|
2B3CF3607B7CB9B7296FD5EF /* (null) in Frameworks */,
|
||||||
DC0E25610BB5F49AFF4514AD /* libPods-Ecency.a in Frameworks */,
|
DC0E25610BB5F49AFF4514AD /* libPods-Ecency.a in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
@ -1071,7 +1071,7 @@
|
|||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios.eshare;
|
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios.eshare;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = ios_dev_group;
|
PROVISIONING_PROFILE_SPECIFIER = "extension-dev";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@ -1090,7 +1090,7 @@
|
|||||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||||
CODE_SIGN_ENTITLEMENTS = eshare/eshare.entitlements;
|
CODE_SIGN_ENTITLEMENTS = eshare/eshare.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
@ -1103,7 +1103,7 @@
|
|||||||
MTL_FAST_MATH = YES;
|
MTL_FAST_MATH = YES;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios.eshare;
|
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios.eshare;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "extension-dist";
|
PROVISIONING_PROFILE_SPECIFIER = "extension-dev";
|
||||||
SKIP_INSTALL = YES;
|
SKIP_INSTALL = YES;
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@ -1196,7 +1196,7 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CODE_SIGN_ENTITLEMENTS = Ecency/Ecency.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Ecency/Ecency.entitlements;
|
||||||
CODE_SIGN_IDENTITY = "iPhone Distribution";
|
CODE_SIGN_IDENTITY = "iPhone Developer";
|
||||||
CODE_SIGN_STYLE = Manual;
|
CODE_SIGN_STYLE = Manual;
|
||||||
CURRENT_PROJECT_VERSION = 2794;
|
CURRENT_PROJECT_VERSION = 2794;
|
||||||
DEAD_CODE_STRIPPING = NO;
|
DEAD_CODE_STRIPPING = NO;
|
||||||
@ -1255,7 +1255,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios;
|
PRODUCT_BUNDLE_IDENTIFIER = app.esteem.mobile.ios;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = ios_dist_app;
|
PROVISIONING_PROFILE_SPECIFIER = ios_dev_app;
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Ecency-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Ecency-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
@ -168,14 +168,14 @@ const PostsContainer = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const cacheReducer = (state, action) => {
|
const cacheReducer = (state, action) => {
|
||||||
// console.log('reducer action:', state, action);
|
console.log('reducer action:', action);
|
||||||
|
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case 'is-filter-loading': {
|
case 'is-filter-loading': {
|
||||||
const filter = action.payload.filter;
|
const filter = action.payload.filter;
|
||||||
const loading = action.payload.isLoading;
|
const loading = action.payload.isLoading;
|
||||||
state.cachedData[filter].isLoading = loading;
|
state.cachedData[filter].isLoading = loading;
|
||||||
// console.log('New state:', state);
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,7 +215,6 @@ const PostsContainer = ({
|
|||||||
cachedEntry.posts = _posts;
|
cachedEntry.posts = _posts;
|
||||||
|
|
||||||
state.cachedData[filter] = cachedEntry;
|
state.cachedData[filter] = cachedEntry;
|
||||||
// console.log('New state:', state);
|
|
||||||
|
|
||||||
//dispatch to redux
|
//dispatch to redux
|
||||||
if (
|
if (
|
||||||
@ -237,7 +236,6 @@ const PostsContainer = ({
|
|||||||
cachedEntry.posts = [];
|
cachedEntry.posts = [];
|
||||||
|
|
||||||
state.cachedData[filter] = cachedEntry;
|
state.cachedData[filter] = cachedEntry;
|
||||||
// console.log('New state:', state);
|
|
||||||
|
|
||||||
//dispatch to redux
|
//dispatch to redux
|
||||||
_setFeedPosts([]);
|
_setFeedPosts([]);
|
||||||
@ -248,7 +246,6 @@ const PostsContainer = ({
|
|||||||
case 'change-filter': {
|
case 'change-filter': {
|
||||||
const filter = action.payload.currentFilter;
|
const filter = action.payload.currentFilter;
|
||||||
state.currentFilter = filter;
|
state.currentFilter = filter;
|
||||||
// console.log('New state:', state);
|
|
||||||
|
|
||||||
const data = state.cachedData[filter !== 'feed' ? filter : state.currentSubFilter];
|
const data = state.cachedData[filter !== 'feed' ? filter : state.currentSubFilter];
|
||||||
_setFeedPosts(data.posts, data.scrollPosition);
|
_setFeedPosts(data.posts, data.scrollPosition);
|
||||||
@ -264,7 +261,7 @@ const PostsContainer = ({
|
|||||||
case 'change-sub-filter': {
|
case 'change-sub-filter': {
|
||||||
const filter = action.payload.currentSubFilter;
|
const filter = action.payload.currentSubFilter;
|
||||||
state.currentSubFilter = filter;
|
state.currentSubFilter = filter;
|
||||||
// console.log('New state:', state);
|
|
||||||
//dispatch to redux;
|
//dispatch to redux;
|
||||||
const data = state.cachedData[filter];
|
const data = state.cachedData[filter];
|
||||||
_setFeedPosts(data.posts, data.scrollPosition);
|
_setFeedPosts(data.posts, data.scrollPosition);
|
||||||
|
@ -101,7 +101,7 @@ class TransferContainer extends Component {
|
|||||||
}
|
}
|
||||||
if (transferType === 'address_view' && fundType === 'BTC') {
|
if (transferType === 'address_view' && fundType === 'BTC') {
|
||||||
//TODO implement transfer of custom tokens
|
//TODO implement transfer of custom tokens
|
||||||
// console.log(tokenAddress);
|
console.log(tokenAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
const local = await getUserDataWithUsername(username);
|
const local = await getUserDataWithUsername(username);
|
||||||
|
@ -458,7 +458,7 @@ export const getActiveVotes = (author, permlink) =>
|
|||||||
|
|
||||||
export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
||||||
try {
|
try {
|
||||||
// console.log('Getting ranked posts:', query);
|
console.log('Getting ranked posts:', query);
|
||||||
let posts = await client.call('bridge', 'get_ranked_posts', query);
|
let posts = await client.call('bridge', 'get_ranked_posts', query);
|
||||||
|
|
||||||
if (posts) {
|
if (posts) {
|
||||||
@ -471,7 +471,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
|||||||
return updatedPosts;
|
return updatedPosts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log('Returning fetched posts: ' + posts ? posts.length : null);
|
console.log('Returning fetched posts: ' + posts ? posts.length : null);
|
||||||
return posts;
|
return posts;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return error;
|
return error;
|
||||||
@ -480,7 +480,7 @@ export const getRankedPosts = async (query, currentUserName, filterNsfw) => {
|
|||||||
|
|
||||||
export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
||||||
try {
|
try {
|
||||||
// console.log('Getting account posts: ', query);
|
console.log('Getting account posts: ', query);
|
||||||
let posts = await client.call('bridge', 'get_account_posts', query);
|
let posts = await client.call('bridge', 'get_account_posts', query);
|
||||||
|
|
||||||
if (posts) {
|
if (posts) {
|
||||||
@ -493,7 +493,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
|||||||
return updatedPosts;
|
return updatedPosts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// console.log('Returning fetched posts: ' + posts ? posts.length : null);
|
console.log('Returning fetched posts: ' + posts ? posts.length : null);
|
||||||
return posts;
|
return posts;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return error;
|
return error;
|
||||||
@ -502,7 +502,7 @@ export const getAccountPosts = async (query, currentUserName, filterNsfw) => {
|
|||||||
|
|
||||||
export const getRepliesByLastUpdate = async (query) => {
|
export const getRepliesByLastUpdate = async (query) => {
|
||||||
try {
|
try {
|
||||||
// console.log('Getting replies: ', query);
|
console.log('Getting replies: ', query);
|
||||||
const replies = await client.database.call('get_replies_by_last_update', [
|
const replies = await client.database.call('get_replies_by_last_update', [
|
||||||
query.start_author,
|
query.start_author,
|
||||||
query.start_permlink,
|
query.start_permlink,
|
||||||
@ -517,7 +517,7 @@ export const getRepliesByLastUpdate = async (query) => {
|
|||||||
|
|
||||||
export const getPost = async (author, permlink, currentUserName = null, isPromoted = false) => {
|
export const getPost = async (author, permlink, currentUserName = null, isPromoted = false) => {
|
||||||
try {
|
try {
|
||||||
// console.log('Getting post: ', author, permlink);
|
console.log('Getting post: ', author, permlink);
|
||||||
const post = await client.database.call('get_content', [author, permlink]);
|
const post = await client.database.call('get_content', [author, permlink]);
|
||||||
return post ? parsePost(post, currentUserName, isPromoted) : null;
|
return post ? parsePost(post, currentUserName, isPromoted) : null;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -654,7 +654,7 @@ export const signImage = async (file, currentAccount, pin) => {
|
|||||||
export const vote = (account, pin, author, permlink, weight) =>
|
export const vote = (account, pin, author, permlink, weight) =>
|
||||||
_vote(account, pin, author, permlink, weight).then((resp) => {
|
_vote(account, pin, author, permlink, weight).then((resp) => {
|
||||||
userActivity(account.username, 120, resp.block_num, resp.id);
|
userActivity(account.username, 120, resp.block_num, resp.id);
|
||||||
// console.log('Returning vote response');
|
console.log('Returning vote response');
|
||||||
return resp;
|
return resp;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ const persistedReducer = persistReducer(persistConfig, reducer);
|
|||||||
|
|
||||||
const middleware = [thunk];
|
const middleware = [thunk];
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
// middleware.push(logger);
|
middleware.push(logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
const store = createStore(persistedReducer, applyMiddleware(...middleware));
|
const store = createStore(persistedReducer, applyMiddleware(...middleware));
|
||||||
|
@ -164,7 +164,7 @@ class EditorContainer extends Component {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
// console.log(error, error.message);
|
console.log(error, error.message);
|
||||||
if (error.toString().includes('code 413')) {
|
if (error.toString().includes('code 413')) {
|
||||||
Alert.alert(
|
Alert.alert(
|
||||||
intl.formatMessage({
|
intl.formatMessage({
|
||||||
|
Loading…
Reference in New Issue
Block a user