Commit a3c82166 authored by Emily Ring's avatar Emily Ring

Remove Visibility from terraform widget

Visibility is causing polling bugs so
removed from vue component
parent 4f46a580
......@@ -5,7 +5,6 @@ import axios from '~/lib/utils/axios_utils';
import CiIcon from '../../vue_shared/components/ci_icon.vue';
import flash from '~/flash';
import Poll from '~/lib/utils/poll';
import Visibility from 'visibilityjs';
export default {
name: 'MRWidgetTerraformPlan',
......@@ -68,7 +67,11 @@ export default {
method: 'fetchPlans',
successCallback: ({ data }) => {
this.plans = data;
if (Object.keys(this.plan).length > 0) {
this.loading = false;
poll.stop();
}
},
errorCallback: () => {
this.plans = {};
......@@ -77,17 +80,9 @@ export default {
},
});
if (!Visibility.hidden()) {
if (this.loading) {
poll.makeRequest();
}
Visibility.change(() => {
if (!Visibility.hidden()) {
poll.restart();
} else {
poll.stop();
}
});
},
},
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment