Prevent empty change events being fired on actions that just delegate to sources

This commit is contained in:
Brett Sun 2016-01-15 13:56:56 +01:00
parent e5a8ebd623
commit f4eef6b7c8
4 changed files with 26 additions and 0 deletions

View File

@ -27,6 +27,9 @@ class EditionStore {
onFetchEdition(editionId) {
this.getInstance().lookupEdition(editionId);
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessFetchEdition({ edition }) {

View File

@ -22,6 +22,10 @@ class UserStore {
if (invalidateCache || !this.getInstance().isLoading()) {
this.getInstance().lookupCurrentUser(invalidateCache);
}
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessFetchCurrentUser({ users: [ user = {} ] }) {
@ -31,6 +35,10 @@ class UserStore {
onLogoutCurrentUser() {
this.getInstance().performLogoutCurrentUser();
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessLogoutCurrentUser() {

View File

@ -25,6 +25,10 @@ class WebhookStore {
if (invalidateCache || !this.getInstance().isLoading()) {
this.getInstance().lookupWebhooks(invalidateCache);
}
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessFetchWebhooks({ webhooks = [] }) {
@ -38,6 +42,10 @@ class WebhookStore {
if (invalidateCache || !this.getInstance().isLoading()) {
this.getInstance().lookupWebhookEvents(invalidateCache);
}
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessFetchWebhookEvents({ events }) {
@ -58,6 +66,9 @@ class WebhookStore {
onRemoveWebhook(webhookId) {
this.getInstance().performRemoveWebhook(webhookId);
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessRemoveWebhook() {

View File

@ -22,6 +22,10 @@ class WhitelabelStore {
if (invalidateCache || !this.getInstance().isLoading()) {
this.getInstance().lookupWhitelabel(invalidateCache);
}
// Prevent alt from sending an empty change event when a request is sent
// off to the source
this.preventDefault();
}
onSuccessFetchWhitelabel({ whitelabel = {} }) {