Cleanup, web: rename subscribedJob to subscribedJobID

The prop contains the job ID, not the job itself, which is now reflected
in the name.

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2022-05-20 11:26:06 +02:00
parent adc8738e5b
commit 34bccd9277
2 changed files with 8 additions and 8 deletions

View File

@ -15,7 +15,7 @@ export default {
// SocketIO events:
"sioReconnected", "sioDisconnected"
],
props: ["websocketURL", "subscribedJob"],
props: ["websocketURL", "subscribedJobID", "subscribedTaskID"],
data() {
return {
socket: null,
@ -36,12 +36,12 @@ export default {
this.disconnectWebsocket();
},
watch: {
subscribedJob(newJob, oldJob) {
if (oldJob) {
this._updateJobSubscription("unsubscribe", oldJob);
subscribedJobID(newJobID, oldJobID) {
if (oldJobID) {
this._updateJobSubscription("unsubscribe", oldJobID);
}
if (newJob) {
this._updateJobSubscription("subscribe", newJob);
if (newJobID) {
this._updateJobSubscription("subscribe", newJobID);
}
},
},
@ -148,7 +148,7 @@ export default {
// Resubscribe to whatever we want to be subscribed to:
_resubscribe() {
if (this.subscribedJob) this._updateJobSubscription("subscribe", this.subscribedJob);
if (this.subscribedJobID) this._updateJobSubscription("subscribe", this.subscribedJobID);
},
},
};

View File

@ -13,7 +13,7 @@
<footer class="window-footer" v-if="!showFooterPopup" @click="showFooterPopup = true"><notification-bar /></footer>
<footer-popup v-if="showFooterPopup" ref="footerPopup" @clickClose="showFooterPopup = false" />
<update-listener ref="updateListener" :websocketURL="websocketURL" :subscribedJob="jobID"
<update-listener ref="updateListener" :websocketURL="websocketURL" :subscribedJobID="jobID"
@jobUpdate="onSioJobUpdate" @taskUpdate="onSioTaskUpdate" @message="onChatMessage"
@sioReconnected="onSIOReconnected" @sioDisconnected="onSIODisconnected" />
</template>