You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a plugin and included it in app/js/myapp/main.js. It runs properly (the "run" method is executed) on item creation or editing. But it doesn't work when I edit an item from outbox that failed to be synced.
The text was updated successfully, but these errors were encountered:
Yes, this is due to a quirk in how plugins are registered by wq/app.js. Plugins trigger based on registered URL patterns, but the url for items in the outbox is /outbox/1. It shouldn't be too hard to either change the URL for outbox items (to e.g. /mymodels/outbox-1) or put in an extra bit of code to make sure that the plugin runs. In the meantime you could try using the lower-level router API to get it working:
define(['wq/router','wq/outbox','./myplugin'],function(router,outbox,myplugin){router.addRoute('outbox/<slug>','s',function(match,ui,params,hash,evt,$page){outbox.model.find(match[1]).then(function(outboxItem){varrouteInfo={// compute from outboxItem};myplugin.run($page,routeInfo);});});});
I wrote a plugin and included it in app/js/myapp/main.js. It runs properly (the "run" method is executed) on item creation or editing. But it doesn't work when I edit an item from outbox that failed to be synced.
The text was updated successfully, but these errors were encountered: