Results 1 to 4 of 4

Thread: how to: application launch promise

  1. #1

    Default Answered: how to: application launch promise

    Hey guys

    I would like to create a promise on application launch and block application from starting before promise is resolved.

    Any ideas ?
    overriding application method with
    HTML Code:
    lanuch() {
     return false 
    }
    still lanuches application ...

    regards

    Armando

  2. What do you mean to "application starts"?
    If you mean to show components, you probably need to remove the "mainView" config from the initial config of you Application and set it only when your asynchronus preloading is done.

    Es.
    Code:
        launch: function () {
    
    
            // Check user logged-in
            const me = this;
            me.loadUser()
                .then(function (user) {
                    me.setMainView({xtype: 'mainview'});
                })
                .catch(function (status) {
                    if (status !== 401) {
                        me.logout();
                    }
                })
                .always(function () {
                    // Remove loading background if any
                });
        },

  3. #2

    Default

    to rephrase the question:

    how does one do some asynchronus preloading, which must complete, before application starts ?

    Regards

    Armando

  4. #3

    Join Date
    Dec 2013
    Location
    Italy
    Posts
    88
    Answers
    9

    Default

    What do you mean to "application starts"?
    If you mean to show components, you probably need to remove the "mainView" config from the initial config of you Application and set it only when your asynchronus preloading is done.

    Es.
    Code:
        launch: function () {
    
    
            // Check user logged-in
            const me = this;
            me.loadUser()
                .then(function (user) {
                    me.setMainView({xtype: 'mainview'});
                })
                .catch(function (status) {
                    if (status !== 401) {
                        me.logout();
                    }
                })
                .always(function () {
                    // Remove loading background if any
                });
        },

  5. #4

    Default

    this does it ... regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •