Skip to content

Commit

Permalink
[renderer][connectors] sort connectors boxes by port so after refresh…
Browse files Browse the repository at this point in the history
… it will be the same order
  • Loading branch information
EvanBldy committed Feb 16, 2022
1 parent 90cdad7 commit c050400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/renderer/src/components/modals/AddPreviewModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ export default {
refreshConnectedDCCClients() {
this.DCCClients = []
for (let port = 10000; port <= 10099; port++) {
let newClient = new DCCClient(`http://localhost:${port}`)
let newClient = new DCCClient(port)
newClient
.getInformation()
.then(() => {
Expand All @@ -372,6 +372,7 @@ export default {
newClient.getExtensions(true).then(() => {
newClient.getExtensions(false).then(() => {
this.DCCClients.push(newClient)
this.DCCClients.sort((a,b) => a.port - b.port)
})
})
})
Expand Down
5 changes: 3 additions & 2 deletions app/renderer/src/lib/dccutils.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import apisauce from 'apisauce'

class DCCClient {
constructor(baseURL) {
this.baseURL = baseURL
constructor(port) {
this.port = port
this.baseURL = `http://localhost:${port}`
this.api = apisauce.create({ baseURL: this.baseURL })
this.isCurrentlyOnTakeScreenshot = false
this.isCurrentlyOnTakeAnimation = false
Expand Down

0 comments on commit c050400

Please sign in to comment.