Преглед изворни кода

Fixed notification page frozen issue

wudebin пре 1 месец
родитељ
комит
0051808366

+ 9 - 10
Strides-SPAPP/app/pages/alert/Notification.js

@@ -24,7 +24,7 @@ export default class Notification extends Component {
       countInfo: {},
       countInfo: {},
       pageAdapter: []
       pageAdapter: []
     };
     };
-    this.pageAdapterAll = [{
+    this.pageAdapterAll =[{
       title: $t('notification.tabCampaign'),
       title: $t('notification.tabCampaign'),
       name: "Campaigns",
       name: "Campaigns",
       component: ListCampaign
       component: ListCampaign
@@ -60,26 +60,21 @@ export default class Notification extends Component {
   componentDidMount() {
   componentDidMount() {
     if (app.notifications.showCampaigns && app.notifications.showArticle) {
     if (app.notifications.showCampaigns && app.notifications.showArticle) {
       this.setState({
       this.setState({
-        ready: true,
         pageAdapter: this.pageAdapterAll
         pageAdapter: this.pageAdapterAll
       }, () => {
       }, () => {
         setTimeout(() => {
         setTimeout(() => {
           this.init();
           this.init();
-        }, 500);
+        }, isIOS ? 500 : 100);
       });
       });
     } else if (app.notifications.showArticle) {
     } else if (app.notifications.showArticle) {
       this.setState({
       this.setState({
-        ready: true,
         pageAdapter: this.pageAdapter
         pageAdapter: this.pageAdapter
       }, () => {
       }, () => {
         setTimeout(() => {
         setTimeout(() => {
           this.init();
           this.init();
-        }, 500);
+        }, isIOS ? 500 : 100);
       });
       });
     } else {
     } else {
-      this.setState({
-        ready: true
-      })
       this.init();
       this.init();
     }
     }
     
     
@@ -101,7 +96,11 @@ export default class Notification extends Component {
 
 
   init() {
   init() {
     utils.setBackClick([this.props?.route?.name, "Campaigns", "Alerts", "Promotions"], this.backPage)
     utils.setBackClick([this.props?.route?.name, "Campaigns", "Alerts", "Promotions"], this.backPage)
-    this.getTotalCount();
+    this.setState({
+      ready: true
+    }, () => {
+      this.getTotalCount();
+    })
     //BackHandler.addEventListener('hardwareBackPress', this.backPage)
     //BackHandler.addEventListener('hardwareBackPress', this.backPage)
     AlertUtil.setOnRefreshListener(() => {
     AlertUtil.setOnRefreshListener(() => {
       this.getTotalCount();
       this.getTotalCount();
@@ -175,7 +174,7 @@ export default class Notification extends Component {
           <Tab.Navigator
           <Tab.Navigator
             style={styles.container}
             style={styles.container}
             screenOptions={{
             screenOptions={{
-              lazy: isIOS,
+              lazy: false,
               lazyPreloadDistance: 2,
               lazyPreloadDistance: 2,
               swipeEnabled: true,
               swipeEnabled: true,
               ...this.tabBarStyle
               ...this.tabBarStyle

+ 2 - 2
Strides-SPAPP/ios/ChargEco.xcodeproj/project.pbxproj

@@ -1282,7 +1282,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = ChargEco/ChargEco.entitlements;
 				CODE_SIGN_ENTITLEMENTS = ChargEco/ChargEco.entitlements;
-				CURRENT_PROJECT_VERSION = 512;
+				CURRENT_PROJECT_VERSION = 514;
 				DEVELOPMENT_TEAM = 3L3U7K6Q28;
 				DEVELOPMENT_TEAM = 3L3U7K6Q28;
 				ENABLE_BITCODE = NO;
 				ENABLE_BITCODE = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
@@ -1431,7 +1431,7 @@
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CODE_SIGN_ENTITLEMENTS = ChargEco/ChargEco.entitlements;
 				CODE_SIGN_ENTITLEMENTS = ChargEco/ChargEco.entitlements;
-				CURRENT_PROJECT_VERSION = 512;
+				CURRENT_PROJECT_VERSION = 514;
 				DEVELOPMENT_TEAM = 3L3U7K6Q28;
 				DEVELOPMENT_TEAM = 3L3U7K6Q28;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				ENABLE_USER_SCRIPT_SANDBOXING = NO;
 				HEADER_SEARCH_PATHS = (
 				HEADER_SEARCH_PATHS = (