]> git.proxmox.com Git - proxmox-widget-toolkit.git/commitdiff
fix #4612: mobile: avoid crash due to missing getProxy method
authorFriedrich Weber <f.weber@proxmox.com>
Fri, 24 Mar 2023 09:02:30 +0000 (10:02 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sun, 26 Mar 2023 15:36:55 +0000 (17:36 +0200)
A previous commit (51083ee) added an override of the internal ExtJS
method `Ext.data.Store.onProxyLoad` in order to fix a race condition.
This override calls `Operation.getProxy`. However, this method is not
available on Sencha Touch. As a consequence, the mobile UI was
broken.

This commit modifies the override such that it has no effect in the
mobile UI.

Fixes: 51083ee54aa98af5a711622e4ed240840dcbbabe
Suggested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
src/Utils.js

index 34c348fde912cfd9de853d69c8d00db9174c4bbd..ef72630951b64569ca7195faba8e2079e4ff7012 100644 (file)
@@ -1483,10 +1483,11 @@ Ext.override(Ext.data.Store, {
     // If the store's proxy is changed while it is waiting for an AJAX
     // response, `onProxyLoad` will still be called for the outdated response.
     // To avoid displaying inconsistent information, only process responses
     // If the store's proxy is changed while it is waiting for an AJAX
     // response, `onProxyLoad` will still be called for the outdated response.
     // To avoid displaying inconsistent information, only process responses
-    // belonging to the current proxy.
+    // belonging to the current proxy. However, do not apply this workaround
+    // to the mobile UI, as Sencha Touch has an incompatible internal API.
     onProxyLoad: function(operation) {
        let me = this;
     onProxyLoad: function(operation) {
        let me = this;
-       if (operation.getProxy() === me.getProxy()) {
+       if (Proxmox.Utils.toolkit === 'touch' || operation.getProxy() === me.getProxy()) {
            me.callParent(arguments);
        } else {
            console.log(`ignored outdated response: ${operation.getRequest().getUrl()}`);
            me.callParent(arguments);
        } else {
            console.log(`ignored outdated response: ${operation.getRequest().getUrl()}`);